/* Modern Liquid Glassmorphic UI Design System */
/* Optional display fonts are loaded asynchronously by the document shell.
   Keeping this stylesheet self-contained avoids a second critical request
   chain before the first student screen can paint. */

:root {
  --font-sans: "Sukhumvit Set", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color Palette (HSL Harmony - Dark Mode Base) */
  --bg-base: #080c14;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary: 99, 102, 241;       /* Indigo: rgb(99, 102, 241) */
  --primary-glow: rgba(99, 102, 241, 0.15);
  
  --secondary: 168, 85, 247;     /* Purple: rgb(168, 85, 247) */
  --accent: 20, 184, 166;        /* Teal: rgb(20, 184, 166) */
  --accent-glow: rgba(20, 184, 166, 0.2);
  
  --success: 34, 197, 94;        /* Green */
  --warning: 234, 179, 8;        /* Yellow */
  --danger: 239, 68, 68;         /* Red */
  
  /* Glassmorphism Tokens */
  --glass-bg: rgba(15, 23, 42, 0.45);
  --glass-border: rgba(255, 255, 255, 0.04);
  --glass-border-hover: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
  --glass-blur: blur(20px);
  
  /* Readability Base */
  --read-bg: #0f172a;
  --read-border: rgba(255, 255, 255, 0.12);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  
  --blob-opacity: 0.45;
  --blob-blend: screen;

  /* Section Heading custom variables */
  --section-text: #93c5fd;
  --section-bg-gradient: linear-gradient(90deg, rgba(37, 99, 235, 0.25) 0%, rgba(37, 99, 235, 0.02) 100%);
  --section-border: rgba(59, 130, 246, 0.3);
  --section-builder-bg: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(37, 99, 235, 0.04) 100%);

  /* Practice Mode variables */
  --practice-trans-bg: rgba(255, 255, 255, 0.03);
  --practice-trans-color: var(--text-secondary);
  --practice-trans-border: var(--glass-border);

  --hint-inactive-bg: rgba(234, 179, 8, 0.1);
  --hint-inactive-color: rgb(253, 224, 71);
  --hint-inactive-border: rgba(234, 179, 8, 0.3);

  --hint-l1-bg: rgba(45, 212, 191, 0.15);
  --hint-l1-color: #2dd4bf;
  --hint-l1-border: rgba(45, 212, 191, 0.3);

  --hint-l2-bg: rgba(129, 140, 248, 0.15);
  --hint-l2-color: #818cf8;
  --hint-l2-border: rgba(129, 140, 248, 0.3);

  --hint-l3-bg: rgba(244, 63, 94, 0.15);
  --hint-l3-color: #f43f5e;
  --hint-l3-border: rgba(244, 63, 94, 0.3);

  --hint-reveal-bg: rgba(239, 68, 68, 0.15);
  --hint-reveal-color: #f43f5e;
  --hint-reveal-border: rgba(239, 68, 68, 0.3);

  --hint-expl-bg: rgba(59, 130, 246, 0.1);
  --hint-expl-color: rgb(147, 197, 253);
  --hint-expl-border: rgba(59, 130, 246, 0.3);

  /* Custom Player theme variables */
  --player-controls-bg: rgba(15, 23, 42, 0.95);
  --player-border: rgba(255, 255, 255, 0.08);
  --player-controls-border: rgba(255, 255, 255, 0.06);
  --player-text: #ffffff;
  --player-text-muted: rgba(255, 255, 255, 0.7);
  --player-progress-track: rgba(255, 255, 255, 0.15);
  --player-speed-border: rgba(255, 255, 255, 0.15);
  --player-overlay-bg: rgba(15, 23, 42, 0.45);
  --player-play-btn-bg: rgba(255, 255, 255, 0.95);
  --player-play-btn-icon: #0f172a;
}

/* ==========================================================================
   TEACHER COURSE BUILDER — AUTHORING WORKFLOW
   ========================================================================== */
.course-list-filterbar,
.course-builder-filterbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.course-list-filterbar > div,
.course-builder-filter-search,
.course-builder-filter-control {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.course-list-filterbar > div:first-child,
.course-builder-filter-search {
  flex: 1 1 260px;
}

.course-list-filterbar label,
.course-builder-filterbar label {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
}

.course-list-filterbar > span,
.course-builder-filter-count {
  margin-left: auto;
  align-self: center;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.course-status-badge,
.lesson-status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1;
}

.lesson-content-type-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.lesson-content-type-card {
  margin-bottom: 0 !important;
  padding: 0.85rem;
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.06);
}

.lesson-content-type-help {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.lesson-attached-exam-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.07);
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.45;
}

.lesson-attached-exam-notice span {
  flex: 1 1 14rem;
  min-width: 0;
}

body.dark-theme .lesson-attached-exam-notice {
  border-color: rgba(129, 140, 248, 0.35);
  background: rgba(49, 46, 129, 0.28);
  color: #c7d2fe;
}

.course-builder-workspace .lesson-article-editor {
  height: 220px !important;
  resize: vertical !important;
}

body.light-theme .lesson-content-type-badge {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
}

body.dark-theme .lesson-content-type-badge {
  border-color: #4338ca;
  background: #1e1b4b;
  color: #c7d2fe;
}

.course-status-draft,
.lesson-status-draft {
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
}

.lesson-status-ready {
  color: #d97706;
  background: rgba(245, 158, 11, 0.12);
}

.course-status-published,
.lesson-status-published {
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
}

/* Keep authoring controls readable regardless of the OS-level Tailwind theme. */
body.light-theme .course-list-filterbar,
body.light-theme .course-builder-workspace {
  --course-builder-muted: #64748b;
}

body.dark-theme .course-list-filterbar,
body.dark-theme .course-builder-workspace {
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --course-builder-muted: #94a3b8;
}

.course-list-filterbar > span,
.course-builder-filter-count,
.course-builder-workspace p {
  color: var(--course-builder-muted, var(--text-muted));
}

body.light-theme .course-list-filterbar .form-control,
body.light-theme .course-builder-workspace .form-control {
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
  color: #0f172a !important;
}

body.dark-theme .course-list-filterbar .form-control,
body.dark-theme .course-builder-workspace .form-control {
  border-color: #475569 !important;
  background: #0f172a !important;
  color: #f8fafc !important;
}

body.light-theme .course-list-filterbar .form-control::placeholder,
body.light-theme .course-builder-workspace .form-control::placeholder {
  color: #64748b !important;
  opacity: 1;
}

body.dark-theme .course-list-filterbar .form-control::placeholder,
body.dark-theme .course-builder-workspace .form-control::placeholder {
  color: #94a3b8 !important;
  opacity: 1;
}

body.light-theme .course-status-draft,
body.light-theme .lesson-status-draft {
  color: #475569;
  background: #f1f5f9;
}

body.light-theme .lesson-status-ready {
  color: #92400e;
  background: #fffbeb;
}

body.light-theme .course-status-published,
body.light-theme .lesson-status-published {
  color: #166534;
  background: #f0fdf4;
}

body.dark-theme .course-status-draft,
body.dark-theme .lesson-status-draft {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.16);
}

body.dark-theme .lesson-status-ready {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.16);
}

body.dark-theme .course-status-published,
body.dark-theme .lesson-status-published {
  color: #86efac;
  background: rgba(34, 197, 94, 0.16);
}

body.light-theme .manage-lessons-btn,
body.dark-theme .manage-lessons-btn,
.course-builder-workspace .btn-primary {
  border-color: #4338ca !important;
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
  color: #ffffff !important;
}

body.light-theme .delete-course-btn,
body.dark-theme .delete-course-btn,
.course-builder-workspace .btn-danger {
  border-color: #991b1b !important;
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%) !important;
  color: #ffffff !important;
}

body.light-theme .manage-enrollments-btn,
body.light-theme .edit-course-btn {
  border-color: #cbd5e1 !important;
  background: #f1f5f9 !important;
  color: #334155 !important;
}

body.light-theme .duplicate-course-btn {
  border-color: #c7d2fe !important;
  background: #eef2ff !important;
  color: #4338ca !important;
}

body.light-theme .preview-course-btn {
  border-color: #bae6fd !important;
  background: #f0f9ff !important;
  color: #075985 !important;
}

body.dark-theme .manage-enrollments-btn,
body.dark-theme .edit-course-btn {
  border-color: #475569 !important;
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

body.dark-theme .duplicate-course-btn {
  border-color: #4338ca !important;
  background: #1e1b4b !important;
  color: #c7d2fe !important;
}

body.dark-theme .preview-course-btn {
  border-color: #0369a1 !important;
  background: #082f49 !important;
  color: #bae6fd !important;
}

body.light-theme #save-course-builder-btn {
  border-color: #86efac !important;
  background: #f0fdf4 !important;
  color: #166534 !important;
}

body.light-theme #teacher-course-preview-btn {
  border-color: #7dd3fc !important;
  background: #f0f9ff !important;
  color: #075985 !important;
}

body.light-theme #lock-all-course-btn {
  border-color: #fecaca !important;
  background: #fef2f2 !important;
  color: #991b1b !important;
}

body.light-theme #unlock-all-course-btn {
  border-color: #86efac !important;
  background: #f0fdf4 !important;
  color: #166534 !important;
}

.lesson-metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.04);
}

.lesson-metadata-tags {
  grid-column: 1 / -1;
}

.course-builder-lesson-main {
  min-width: 0;
  flex: 1 1 auto;
}

.course-builder-lesson-content {
  min-width: 0;
  flex: 1 1 auto;
}

.course-builder-lesson-heading-row {
  min-width: 0;
}

.course-builder-lesson-title {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

.course-builder-lesson-main h4,
.course-builder-lesson-main p {
  overflow-wrap: anywhere;
}

.course-builder-lesson-summary {
  margin: 0.35rem 0 0.25rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.course-builder-lesson-summary.is-empty {
  width: fit-content;
  margin-top: 0.5rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-radius: 7px;
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  font-weight: 800;
}

.lesson-content-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  width: fit-content;
  padding: 0.2rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 850;
  white-space: nowrap;
}

.lesson-content-state-badge.has-content {
  border-color: rgba(16, 185, 129, 0.32);
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.lesson-content-state-badge.missing-content {
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

body.dark-theme .lesson-content-state-badge.has-content {
  color: #6ee7b7;
}

body.dark-theme .lesson-content-state-badge.missing-content {
  color: #fbbf24;
}

.course-builder-content-overview,
.course-content-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 12px;
  background: rgba(20, 184, 166, 0.06);
}

.course-builder-content-overview span,
.course-builder-content-overview strong,
.course-content-summary span,
.course-content-summary strong {
  display: block;
}

.course-builder-content-overview span,
.course-content-summary span {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.course-builder-content-overview strong,
.course-content-summary strong {
  margin-top: 0.18rem;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 850;
}

.course-builder-content-overview p,
.course-content-summary small {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 750;
}

body.dark-theme .course-builder-lesson-summary.is-empty {
  color: #fbbf24;
}

.course-builder-lesson-actions .toggle-lesson-publish-btn {
  min-width: 74px;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
}

.toggle-lesson-publish-btn.is-publish {
  border: 1px solid rgba(16, 185, 129, 0.38);
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.toggle-lesson-publish-btn.is-unpublish {
  border: 1px solid rgba(99, 102, 241, 0.42);
  background: rgba(99, 102, 241, 0.11);
  color: #4f46e5;
}

body.dark-theme .toggle-lesson-publish-btn.is-publish {
  color: #6ee7b7;
}

body.dark-theme .toggle-lesson-publish-btn.is-unpublish {
  color: #a5b4fc;
}

.course-builder-lesson-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 1180px) {
  .course-builder-lesson-card {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 0.85rem;
  }

  .course-builder-lesson-actions {
    width: 100%;
    justify-content: flex-start;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
  }

  .course-builder-lesson-main {
    width: 100%;
  }

  .course-builder-lesson-heading-row {
    display: grid !important;
    grid-template-columns: max-content max-content minmax(0, 1fr);
    gap: 0.45rem !important;
    width: 100%;
  }

  .course-builder-lesson-title {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
  }

  .course-builder-lesson-heading-row .lesson-content-type-badge {
    grid-column: 1;
    grid-row: 2;
  }

  .course-builder-lesson-heading-row .lesson-status-badge {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 1024px) {
  .course-builder-workspace-header {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 1rem;
  }

  .course-builder-header-actions {
    position: sticky;
    top: 0.5rem;
    z-index: 30;
    width: 100%;
    padding: 0.6rem;
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card-bg, rgba(15, 23, 42, 0.92)) 92%, transparent);
    backdrop-filter: blur(14px);
  }

  .course-builder-layout {
    display: flex !important;
    flex-direction: column;
  }

  .course-builder-editor-panel {
    position: sticky !important;
    bottom: 0;
    top: auto !important;
    z-index: 45;
    order: -1;
    width: 100%;
    max-height: min(58vh, 620px) !important;
    padding: 0.5rem !important;
    overflow-y: auto;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    background: var(--glass-bg, rgba(15, 23, 42, 0.94));
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
  }

  .course-builder-organizer {
    padding: 1rem !important;
  }
}

@media (max-width: 768px) {
  .course-list-filterbar,
  .course-builder-filterbar {
    align-items: stretch;
  }

  .course-list-filterbar > *,
  .course-builder-filterbar > * {
    width: 100%;
  }

  .course-list-filterbar > span,
  .course-builder-filter-count {
    margin-left: 0;
  }

  .lesson-metadata-grid {
    grid-template-columns: 1fr;
  }

  .lesson-metadata-tags {
    grid-column: auto;
  }

  .course-builder-lesson-main > div:last-child > div:first-child {
    align-items: flex-start !important;
    flex-wrap: wrap;
  }

  .course-builder-lesson-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.3rem;
  }

  .course-builder-lesson-actions .btn {
    width: auto !important;
    min-width: max-content;
    flex: 0 0 auto !important;
  }

  .course-builder-lesson-actions .toggle-lesson-lock-btn,
  .course-builder-lesson-actions .toggle-lesson-publish-btn,
  .course-builder-lesson-actions .preview-lesson-btn,
  .course-builder-lesson-actions .duplicate-lesson-btn,
  .course-builder-lesson-actions .edit-lesson-btn,
  .course-builder-lesson-actions .delete-lesson-btn {
    flex: 1 1 calc(33.333% - 0.35rem);
  }
}

/* Compact teacher lesson cards: title on its own row, media status and actions on one line. */
.course-builder-lesson-card {
  display: block !important;
  width: 100%;
  min-width: 0;
  padding: 0.72rem 0.85rem !important;
}

.course-builder-lesson-card .course-builder-lesson-main {
  display: flex !important;
  align-items: flex-start !important;
  width: 100%;
  min-width: 0;
  gap: 0.6rem !important;
}

.course-builder-lesson-card .course-builder-lesson-content {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

.course-builder-lesson-card .course-builder-lesson-heading-row {
  display: flex !important;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 0.45rem !important;
}

.course-builder-lesson-card .lesson-content-type-badge,
.course-builder-lesson-card .lesson-status-badge {
  flex: 0 0 auto;
}

.course-builder-lesson-card .course-builder-lesson-title {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.25;
}

.course-builder-lesson-card .course-builder-lesson-summary {
  max-width: 100%;
  margin: 0.25rem 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-builder-lesson-card .course-builder-lesson-summary:not(.is-empty) {
  display: none;
}

.course-builder-lesson-info-actions {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 0.55rem;
  margin-top: 0.42rem;
}

.course-builder-lesson-meta {
  display: flex !important;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap !important;
  gap: 0.55rem !important;
  margin-top: 0 !important;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.7rem !important;
}

.course-builder-lesson-meta > span {
  flex: 0 0 auto;
  max-width: 20rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-builder-lesson-actions {
  display: flex !important;
  align-items: center;
  flex: 0 1 auto;
  width: auto !important;
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap !important;
  justify-content: flex-end;
  gap: 0.25rem !important;
  margin-left: auto;
  padding: 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.course-builder-lesson-actions .btn {
  flex: 0 0 auto !important;
  min-width: max-content;
  white-space: nowrap;
  padding: 0.25rem 0.45rem !important;
  font-size: 0.7rem !important;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .course-builder-lesson-info-actions {
    align-items: center;
    gap: 0.4rem;
  }

  .course-builder-lesson-meta {
    flex: 1 1 8rem;
  }

  .course-builder-lesson-actions {
    flex: 0 1 58%;
    justify-content: flex-start;
  }
}

/* Access management and license redemption */
.access-page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.access-page-head,
.access-panel-head,
.access-detail-head,
.access-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.access-page-head h1,
.redeem-copy h1 {
  margin: 2px 0 4px;
  color: var(--text-primary);
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0;
}

.access-page-head p,
.access-panel-head p,
.access-modal-head p,
.redeem-copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
}

.access-eyebrow {
  color: #0d9488;
  font-size: 0.7rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
}

.access-create-batch-btn,
.access-detail-actions .btn,
.access-manual-submit,
.redeem-submit,
.access-modal-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  border-radius: 7px;
}

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

.access-metric {
  min-width: 0;
  min-height: 88px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-hover);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.access-metric-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
}

.access-metric-icon.teal { color: #14b8a6; background: rgba(20, 184, 166, 0.12); }
.access-metric-icon.blue { color: #3b82f6; background: rgba(59, 130, 246, 0.12); }
.access-metric-icon.green { color: #22c55e; background: rgba(34, 197, 94, 0.12); }
.access-metric-icon.amber { color: #d97706; background: rgba(217, 119, 6, 0.12); }

.access-metric div:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.access-metric strong {
  color: var(--text-primary);
  font-size: 1.3rem;
  line-height: 1.15;
  font-weight: 800;
}

.access-metric span:last-child {
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.35;
}

.access-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--glass-border-hover);
}

.access-tab {
  height: 42px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.access-tab:hover { color: var(--text-primary); }
.access-tab.active { color: #0d9488; border-bottom-color: #14b8a6; }

.access-panel {
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-hover);
  border-radius: 8px;
  overflow: hidden;
}

.access-panel-head,
.access-detail-head {
  min-height: 72px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--glass-border-hover);
}

.access-panel-head h2,
.access-modal-head h2 {
  margin: 0 0 3px;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 800;
}

.access-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.access-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  color: var(--text-secondary);
  font-size: 0.79rem;
}

.access-table th {
  padding: 11px 14px;
  color: var(--text-muted);
  background: rgba(100, 116, 139, 0.05);
  border-bottom: 1px solid var(--glass-border-hover);
  text-align: left;
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.access-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--glass-border);
  vertical-align: middle;
}

.access-table tbody tr:last-child td { border-bottom: 0; }
.access-table tbody tr:hover { background: rgba(100, 116, 139, 0.045); }
.access-table td strong { display: block; color: var(--text-primary); font-size: 0.82rem; font-weight: 750; }
.access-table td small { display: block; max-width: 320px; margin-top: 3px; color: var(--text-muted); font-size: 0.71rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.access-resource-type {
  display: inline-block;
  color: #0f766e;
  font-size: 0.68rem;
  font-weight: 800;
}

.access-status {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.68rem;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}

.access-status-active,
.access-status-unused { color: #059669; background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); }
.access-status-used { color: #2563eb; background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.2); }
.access-status-paused { color: #d97706; background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.2); }
.access-status-revoked { color: #dc2626; background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); }

.access-icon-btn,
.access-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--text-secondary);
  background: rgba(100, 116, 139, 0.07);
  border: 1px solid var(--glass-border-hover);
  border-radius: 7px;
  cursor: pointer;
}

.access-icon-btn { width: 34px; height: 34px; padding: 0; }
.access-back-btn { min-height: 36px; padding: 0 11px; font: inherit; font-size: 0.77rem; font-weight: 700; }
.access-icon-btn:hover,
.access-back-btn:hover { color: var(--text-primary); border-color: rgba(20, 184, 166, 0.35); }

.access-detail-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.access-batch-summary {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr repeat(3, minmax(100px, 0.7fr));
  gap: 0;
  border-bottom: 1px solid var(--glass-border-hover);
}

.access-batch-summary > div {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--glass-border);
}

.access-batch-summary > div:last-child { border-right: 0; }
.access-batch-summary span { display: block; margin-bottom: 4px; color: var(--text-muted); font-size: 0.67rem; }
.access-batch-summary strong { display: block; color: var(--text-primary); font-size: 0.79rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.access-serial {
  padding: 4px 7px;
  color: var(--text-primary);
  background: rgba(100, 116, 139, 0.09);
  border: 1px solid var(--glass-border-hover);
  border-radius: 4px;
  font-size: 0.76rem;
  white-space: nowrap;
}

.access-empty,
.access-error,
.access-loading {
  min-height: 260px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--text-muted);
  text-align: center;
}

.access-empty strong,
.access-error strong { color: var(--text-primary); font-size: 0.9rem; }
.access-empty span,
.access-error span { max-width: 430px; font-size: 0.78rem; line-height: 1.5; }

.access-spinner {
  width: 22px;
  height: 22px;
  display: inline-block;
  flex: 0 0 auto;
  border: 2px solid rgba(20, 184, 166, 0.18);
  border-top-color: #14b8a6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.access-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10020;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(5px);
}

.access-modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  color: var(--text-primary);
  background: var(--read-bg);
  border: 1px solid var(--glass-border-hover);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.access-modal-head { padding: 17px 19px; border-bottom: 1px solid var(--glass-border-hover); }
.access-modal form { padding: 18px 19px; display: flex; flex-direction: column; gap: 15px; }
.access-modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

.access-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.access-field > span {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
}

.access-field .form-control { width: 100%; min-height: 42px; border-radius: 6px; font-size: 0.82rem; }
.access-field select.form-control { appearance: auto; }
.access-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.access-resource-picker,
.access-activation-mode {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.access-resource-picker legend,
.access-activation-mode legend {
  margin-bottom: 7px;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
}

.access-resource-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.access-resource-search {
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--glass-border-hover);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

.access-resource-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.82rem;
}

.access-resource-search input::placeholder { color: var(--text-muted); }

.access-resource-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.access-resource-type-tab {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--glass-border-hover);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.access-resource-type-tab.active {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.14);
  color: var(--text-primary);
}

.access-resource-picker-head,
.access-resource-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  align-items: center;
}

.access-resource-picker-head {
  padding: 0 10px 6px;
  color: var(--text-muted);
  font-size: 0.67rem;
}

.access-resource-picker-list {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--glass-border-hover);
  border-radius: 6px;
}

.access-resource-choice {
  padding: 9px 10px;
  border-bottom: 1px solid var(--glass-border);
}

.access-resource-choice.selected {
  background: rgba(99, 102, 241, 0.08);
}

.access-resource-choice:last-child { border-bottom: 0; }
.access-resource-main { min-width: 0; display: flex; align-items: center; gap: 9px; cursor: pointer; }
.access-resource-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.10);
  color: rgb(129, 140, 248);
}
.access-resource-main > span:not(.access-resource-icon) { min-width: 0; display: flex; flex-direction: column; }
.access-resource-main strong { overflow: hidden; color: var(--text-primary); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.access-resource-main small { color: var(--text-muted); font-size: 0.67rem; }
.access-duration-input { min-height: 36px !important; }
.access-duration-control { min-width: 0; display: grid; gap: 4px; }
.access-duration-unlimited-label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.62rem;
  line-height: 1.2;
  cursor: pointer;
}
.access-duration-unlimited-label input { flex: 0 0 auto; }
.access-duration-unlimited-label:has(input:checked) { color: #0d9488; font-weight: 800; }
.access-duration-unlimited-label:has(input:disabled) { opacity: 0.48; cursor: not-allowed; }

.access-resource-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.access-activation-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.access-activation-mode legend { grid-column: 1 / -1; }
.access-activation-mode label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--glass-border-hover);
  border-radius: 6px;
  cursor: pointer;
}
.access-activation-mode label span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.access-activation-mode strong { color: var(--text-primary); font-size: 0.78rem; }
.access-activation-mode small { color: var(--text-muted); font-size: 0.68rem; line-height: 1.4; }

.access-package-summary { padding: 14px 18px; border-bottom: 1px solid var(--glass-border); }
.access-package-mode { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--text-secondary); font-size: 0.76rem; }
.access-package-item { display: grid; grid-template-columns: 92px minmax(0, 1fr) 90px; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--glass-border); }
.access-package-item strong { overflow: hidden; color: var(--text-primary); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.access-package-item small { color: var(--text-muted); font-size: 0.7rem; text-align: right; }

.access-manual-panel { padding-bottom: 20px; }
.access-grant-mode {
  max-width: 720px;
  margin: 18px 20px 0;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border: 1px solid var(--glass-border-hover);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.access-grant-mode-btn {
  min-width: 0;
  min-height: 58px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
}

.access-grant-mode-btn > svg { flex: 0 0 17px; }
.access-grant-mode-btn > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.access-grant-mode-btn strong { color: var(--text-secondary); font-size: 0.8rem; }
.access-grant-mode-btn small { overflow: hidden; font-size: 0.67rem; text-overflow: ellipsis; white-space: nowrap; }
.access-grant-mode-btn.active {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.12);
  color: rgb(129, 140, 248);
}
.access-grant-mode-btn.active strong { color: var(--text-primary); }

.access-license-assign-form {
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.access-license-fields { display: grid; gap: 14px; }
.access-field-help { color: var(--text-muted); font-size: 0.67rem; line-height: 1.4; }
.access-batch-edit-note {
  padding: 9px 11px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 6px;
  background: rgba(20, 184, 166, 0.07);
  color: var(--text-secondary);
}
.access-student-field { min-width: 0; }
.access-student-picker {
  overflow: hidden;
  border: 1px solid var(--glass-border-hover);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
}
.access-student-search {
  min-height: 42px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-muted);
}
.access-student-search > svg { flex: 0 0 15px; }
.access-student-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.74rem;
}
.access-student-picker-head {
  min-height: 35px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.66rem;
}
.access-student-picker-head strong { color: var(--text-primary); }
.access-student-select-visible {
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: rgb(129, 140, 248);
  font: inherit;
  font-size: 0.66rem;
  font-weight: 800;
  cursor: pointer;
}
.access-student-list { max-height: 190px; overflow-y: auto; }
.access-student-choice {
  min-height: 48px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
}
.access-student-choice:last-of-type { border-bottom: 0; }
.access-student-choice.selected { background: rgba(99, 102, 241, 0.08); }
.access-student-choice > input { flex: 0 0 auto; }
.access-student-choice > span { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.access-student-choice strong,
.access-student-choice small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-student-choice strong { color: var(--text-primary); font-size: 0.74rem; }
.access-student-choice small { color: var(--text-muted); font-size: 0.65rem; }
.access-student-empty { padding: 18px; color: var(--text-muted); font-size: 0.72rem; text-align: center; }
.access-license-preview,
.access-summary-sticky {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--glass-border-hover);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}
.access-license-preview-content { min-height: 150px; margin-top: 10px; }
.access-license-preview .access-summary-list { max-height: 220px; overflow-y: auto; }
.access-preview-serial { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.access-license-submit { width: 100%; min-height: 42px; margin-top: 14px; }
.access-license-warning { margin: 8px 0 0; color: var(--text-muted); font-size: 0.66rem; line-height: 1.45; text-align: center; }
.access-license-shortage { margin-top: 10px; padding: 8px 9px; border: 1px solid rgba(239, 68, 68, 0.22); border-radius: 5px; background: rgba(239, 68, 68, 0.08); color: #dc2626; font-size: 0.68rem; line-height: 1.45; }

.access-manual-form {
  padding: 20px;
}
.access-manual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.38fr);
  gap: 18px;
  align-items: start;
}
.access-manual-main { min-width: 0; display: grid; gap: 16px; }
.access-manual-summary { min-width: 0; }
.access-summary-sticky { position: sticky; top: 14px; }
.access-summary-head { display: flex; align-items: center; gap: 8px; color: var(--text-primary); font-size: 0.82rem; }
.access-summary-row { padding: 9px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--glass-border); font-size: 0.7rem; }
.access-summary-row > span { flex: 0 0 auto; color: var(--text-muted); }
.access-summary-row > strong { min-width: 0; color: var(--text-secondary); text-align: right; overflow-wrap: anywhere; }
.access-summary-list { display: grid; gap: 0; }
.access-summary-item { padding: 9px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--glass-border); }
.access-summary-item > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.access-summary-item b { overflow: hidden; color: var(--text-primary); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.access-summary-item small { color: var(--text-muted); font-size: 0.64rem; }
.access-summary-item > strong { flex: 0 0 auto; color: var(--text-secondary); font-size: 0.68rem; }
.access-summary-empty { display: block; padding: 20px 4px; color: var(--text-muted); font-size: 0.72rem; line-height: 1.5; text-align: center; }
.access-existing-badge { margin-left: 6px; padding: 2px 5px; border-radius: 4px; background: rgba(245, 158, 11, 0.12); color: #d97706; font-size: 0.6rem; }
.access-manual-common-duration { max-width: 280px; }
.access-manual-expiry-mode { grid-template-columns: repeat(3, 1fr); }

.access-manual-submit { min-height: 42px; }
[data-grant-panel][hidden] { display: none !important; }

.redeem-page {
  width: 100%;
  min-height: calc(100vh - 190px);
  padding: 30px 16px;
  display: grid;
  place-items: center;
}

.redeem-tool {
  width: min(640px, 100%);
  padding: 28px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-hover);
  border-radius: 8px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.14);
}

.redeem-heading { display: flex; align-items: flex-start; gap: 15px; }

.redeem-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 0;
  display: grid;
  place-items: center;
  color: #0d9488;
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 8px;
}

.redeem-copy { min-width: 0; }
.redeem-copy h1 { font-size: 1.55rem; }
.redeem-copy p { max-width: 470px; }
.redeem-account {
  min-width: 0;
  margin: 18px 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--glass-border-hover);
  border-radius: 6px;
  background: rgba(100, 116, 139, 0.045);
  color: var(--text-muted);
  font-size: 0.72rem;
}
.redeem-account > svg { flex: 0 0 17px; color: #0d9488; }
.redeem-account strong { min-width: 0; margin-left: auto; overflow: hidden; color: var(--text-primary); text-overflow: ellipsis; white-space: nowrap; }
.redeem-tool form { display: flex; flex-direction: column; gap: 13px; }
.redeem-code-input { min-height: 48px !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.95rem !important; text-transform: uppercase; }
.redeem-submit { width: 100%; min-height: 46px; }
.redeem-submit:disabled { opacity: 0.45; box-shadow: none; cursor: not-allowed; }

.redeem-method-tabs {
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border: 1px solid var(--glass-border-hover);
  border-radius: 7px;
  background: rgba(100, 116, 139, 0.045);
}
.redeem-method-tab {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.77rem;
  font-weight: 800;
  cursor: pointer;
}
.redeem-method-tab.active {
  border-color: rgba(20, 184, 166, 0.28);
  background: rgba(20, 184, 166, 0.1);
  color: #0d9488;
}
.redeem-method-panel[hidden] { display: none !important; }

.redeem-camera-shell {
  position: relative;
  min-height: 290px;
  overflow: hidden;
  border: 1px solid var(--glass-border-hover);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.035);
}
.redeem-camera-idle {
  min-height: 290px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
}
.redeem-camera-idle-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 5px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(20, 184, 166, 0.11);
  color: #0d9488;
}
.redeem-camera-idle strong { color: var(--text-primary); font-size: 0.88rem; }
.redeem-camera-idle > span:not(.redeem-camera-idle-icon) { max-width: 360px; color: var(--text-muted); font-size: 0.72rem; line-height: 1.5; }
.redeem-camera-actions { margin-top: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.redeem-camera-actions .btn,
.redeem-image-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 6px; cursor: pointer; }

.redeem-camera-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 290px;
  overflow: hidden;
  background: #05070a;
}
.redeem-camera-video { width: 100%; height: 100%; display: block; object-fit: cover; }
.redeem-camera-facing {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  padding: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
}
.redeem-camera-facing-btn {
  min-height: 32px;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  font: inherit;
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.redeem-camera-facing-btn.active {
  border-color: rgba(45, 212, 191, 0.42);
  background: rgba(20, 184, 166, 0.28);
  color: #fff;
}
.redeem-camera-facing-btn:disabled { opacity: 0.5; cursor: wait; }
.redeem-scan-guide {
  position: absolute;
  width: min(58%, 250px);
  aspect-ratio: 1;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.08);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.32);
}
.redeem-scan-guide span { position: absolute; width: 32px; height: 32px; border-color: #2dd4bf; border-style: solid; }
.redeem-scan-guide span:nth-child(1) { top: 0; left: 0; border-width: 3px 0 0 3px; }
.redeem-scan-guide span:nth-child(2) { top: 0; right: 0; border-width: 3px 3px 0 0; }
.redeem-scan-guide span:nth-child(3) { right: 0; bottom: 0; border-width: 0 3px 3px 0; }
.redeem-scan-guide span:nth-child(4) { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.redeem-camera-stop {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  cursor: pointer;
}
.redeem-camera-status { min-height: 20px; padding: 7px 2px 0; color: var(--text-muted); font-size: 0.69rem; line-height: 1.45; text-align: center; }
.redeem-camera-status.error { color: #dc2626; }
.redeem-camera-status.success { color: #059669; }
.redeem-detected {
  min-height: 290px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: #059669;
}
.redeem-detected > div { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.redeem-detected strong { color: var(--text-primary); font-size: 0.84rem; }
.redeem-detected code { color: var(--text-secondary); font-size: 0.74rem; overflow-wrap: anywhere; }
.redeem-rescan { margin-left: 12px; padding: 7px 9px; border: 1px solid var(--glass-border-hover); border-radius: 5px; background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.7rem; font-weight: 700; cursor: pointer; }
.redeem-input-help { margin-top: -5px; color: var(--text-muted); font-size: 0.68rem; }

.redeem-security {
  margin-top: 15px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 0.71rem;
  line-height: 1.45;
  text-align: center;
}

.redeem-success,
.redeem-failure {
  margin-top: 17px;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid;
  border-radius: 7px;
}

.redeem-success { color: #059669; background: rgba(16, 185, 129, 0.09); border-color: rgba(16, 185, 129, 0.22); }
.redeem-failure { color: #dc2626; background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.2); }
.redeem-success div { display: flex; flex-direction: column; gap: 2px; }
.redeem-success strong { color: var(--text-primary); font-size: 0.84rem; }
.redeem-success span,
.redeem-failure span { font-size: 0.75rem; line-height: 1.45; }

.redeem-login-notice {
  margin: -5px 0 18px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0f766e;
  background: rgba(20, 184, 166, 0.09);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 7px;
}

.redeem-login-notice > svg { width: 22px; height: 22px; flex: 0 0 22px; }
.redeem-login-notice div { display: flex; flex-direction: column; gap: 2px; }
.redeem-login-notice strong { color: var(--text-primary); font-size: 0.78rem; }
.redeem-login-notice span { color: var(--text-secondary); font-size: 0.7rem; line-height: 1.4; }

body.light-theme .access-resource-type,
body.light-theme .access-eyebrow,
body.light-theme .access-tab.active,
body.light-theme .redeem-login-notice { color: #0f766e; }

@media (max-width: 1100px) {
  .access-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-license-assign-form,
  .access-manual-grid { grid-template-columns: 1fr; }
  .access-summary-sticky { position: static; }
  .access-manual-submit { width: 100%; }
  .access-batch-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .access-batch-summary > div { border-bottom: 1px solid var(--glass-border); }
}

@media (max-width: 640px) {
  .access-page { gap: 14px; }
  .access-page-head { align-items: stretch; flex-direction: column; }
  .access-page-head h1,
  .redeem-copy h1 { font-size: 1.35rem; }
  .access-create-batch-btn { width: 100%; min-height: 42px; }
  .access-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .access-metric { min-height: 76px; padding: 11px; gap: 9px; }
  .access-metric-icon { width: 32px; height: 32px; flex-basis: 32px; }
  .access-metric strong { font-size: 1.05rem; }
  .access-metric span:last-child { font-size: 0.66rem; }
  .access-tab { padding: 0 11px; font-size: 0.75rem; }
  .access-detail-head { align-items: stretch; flex-direction: column; }
  .access-detail-actions { display: grid; grid-template-columns: 1fr 1fr auto; }
  .access-detail-actions .btn { width: 100%; }
  .access-batch-summary { grid-template-columns: 1fr 1fr; }
  .access-batch-summary > div { padding: 11px; }
  .access-form-grid,
  .access-activation-mode,
  .access-license-assign-form,
  .access-manual-grid { grid-template-columns: 1fr; }
  .access-grant-mode { margin: 14px 12px 0; grid-template-columns: 1fr; }
  .access-grant-mode-btn small { white-space: normal; }
  .access-license-assign-form,
  .access-manual-form { padding: 14px 12px; }
  .access-student-list { max-height: 220px; }
  .access-manual-common-duration { max-width: none; }
  .access-modal-backdrop { padding: 10px; }
  .access-modal { max-height: calc(100vh - 20px); }
  .access-resource-type-tab { flex: 1 1 auto; }
  .access-resource-picker-head,
  .access-resource-choice { grid-template-columns: minmax(0, 1fr) 124px; gap: 8px; }
  .access-package-item { grid-template-columns: 78px minmax(0, 1fr); }
  .access-package-item small { grid-column: 2; text-align: left; }
  .redeem-page { min-height: calc(100vh - 150px); padding: 12px 0; }
  .redeem-tool { padding: 20px 16px; }
  .redeem-heading { gap: 11px; }
  .redeem-icon { width: 46px; height: 46px; flex: 0 0 46px; }
  .redeem-account { align-items: flex-start; flex-wrap: wrap; }
  .redeem-account strong { width: 100%; margin: 2px 0 0 24px; }
  .redeem-camera-shell,
  .redeem-camera-idle,
  .redeem-camera-stage,
  .redeem-detected { min-height: 250px; }
  .redeem-camera-idle { padding: 22px 14px; }
  .redeem-camera-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .redeem-detected { padding: 18px 14px; flex-wrap: wrap; }
  .redeem-rescan { width: 100%; margin: 8px 0 0; }
}

/* Light Theme Variables override */
body.light-theme {
  --bg-base: #f1f5f9;            /* Soft slate gray */
  --text-primary: #0f172a;       /* Deep slate */
  --text-secondary: #475569;     /* Muted slate */
  --text-muted: #64748b;
  
  /* Glassmorphism Tokens for Light Mode */
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(15, 23, 42, 0.03);
  --glass-border-hover: rgba(15, 23, 42, 0.08);
  --glass-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.02), 0 12px 40px -8px rgba(15, 23, 42, 0.04);
  
  /* Readability Base for Light Mode */
  --read-bg: #f8fafc;
  --read-border: rgba(0, 0, 0, 0.1);
  
  --blob-opacity: 0.25;
  --blob-blend: normal;
  
  --primary-glow: rgba(99, 102, 241, 0.08);
  --accent-glow: rgba(20, 184, 166, 0.1);

  /* Section Heading light theme overrides (darker text) */
  --section-text: #1e3a8a;       /* Dark navy blue */
  --section-bg-gradient: linear-gradient(90deg, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0.01) 100%);
  --section-border: rgba(37, 99, 235, 0.25);
  --section-builder-bg: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.02) 100%);

  /* Practice Mode light theme overrides */
  --practice-trans-bg: rgba(15, 23, 42, 0.05);
  --practice-trans-color: var(--text-secondary);
  --practice-trans-border: rgba(15, 23, 42, 0.15);

  --hint-inactive-bg: rgba(217, 119, 6, 0.08);
  --hint-inactive-color: rgb(180, 83, 9);         /* Dark amber for high contrast */
  --hint-inactive-border: rgba(217, 119, 6, 0.25);

  --hint-l1-bg: rgba(13, 148, 136, 0.1);
  --hint-l1-color: #0d9488;                       /* Darker teal for light mode */
  --hint-l1-border: rgba(13, 148, 136, 0.25);

  --hint-l2-bg: rgba(79, 70, 229, 0.08);
  --hint-l2-color: #4f46e5;                       /* Darker indigo for light mode */
  --hint-l2-border: rgba(79, 70, 229, 0.25);

  --hint-l3-bg: rgba(225, 29, 72, 0.08);
  --hint-l3-color: #e11d48;                       /* Darker rose for light mode */
  --hint-l3-border: rgba(225, 29, 72, 0.25);

  --hint-reveal-bg: rgba(225, 29, 72, 0.1);
  --hint-reveal-color: #e11d48;
  --hint-reveal-border: rgba(225, 29, 72, 0.25);

  --hint-expl-bg: rgba(37, 99, 235, 0.08);
  --hint-expl-color: #2563eb;                     /* Readable blue for light mode */
  --hint-expl-border: rgba(37, 99, 235, 0.25);

  /* Custom Player theme variables for Light Mode */
  --player-controls-bg: rgba(248, 250, 252, 0.95);
  --player-border: rgba(15, 23, 42, 0.08);
  --player-controls-border: rgba(15, 23, 42, 0.08);
  --player-text: #0f172a;
  --player-text-muted: rgba(15, 23, 42, 0.7);
  --player-progress-track: rgba(15, 23, 42, 0.15);
  --player-speed-border: rgba(15, 23, 42, 0.15);
  --player-overlay-bg: rgba(248, 250, 252, 0.45);
  --player-play-btn-bg: rgba(15, 23, 42, 0.95);
  --player-play-btn-icon: #ffffff;
}

body.light-theme h1, 
body.light-theme h2, 
body.light-theme h3, 
body.light-theme h4, 
body.light-theme h5, 
body.light-theme h6 {
  color: #0f172a !important;
}

body.light-theme .glass-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .glass-card:hover {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .glass-panel {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .test-item {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
}

body.light-theme .test-item:hover {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .option-label {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: var(--text-primary) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

body.light-theme .option-label:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

body.light-theme .option-input:checked + .option-label {
  background: #f5f3ff !important;
  border-color: #8b5cf6 !important;
  color: #6d28d9 !important;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.08) !important;
}

body.light-theme .option-letter {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: var(--text-primary) !important;
}

body.light-theme .option-input:checked + .option-label .option-letter {
  background: #8b5cf6 !important;
  border-color: #8b5cf6 !important;
  color: white;
}

body.light-theme .form-control {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
  color: #0f172a;
}

body.light-theme .form-control:focus {
  background: #ffffff;
  border-color: rgb(20, 184, 166);
}

body.light-theme .bubble-btn {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
}

body.light-theme .bubble-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .bubble-btn.active {
  border-color: rgb(99, 102, 241);
  color: rgb(79, 70, 229);
}

body.light-theme .bubble-btn.answered {
  background: rgba(20, 184, 166, 0.1);
  border-color: rgb(20, 184, 166);
  color: rgb(13, 148, 136);
}

body.light-theme .audio-player-card {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .explanation-box {
  background: rgba(0, 0, 0, 0.02);
}

body.light-theme table tr {
  color: var(--text-primary) !important;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Background Liquid Animation Blobs */
.liquid-bg-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--bg-base);
  transition: background-color 0.4s ease;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: var(--blob-opacity);
  mix-blend-mode: var(--blob-blend);
  animation: float-around 25s infinite alternate ease-in-out;
  transition: opacity 0.4s ease, mix-blend-mode 0.4s ease;
}

.blob-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.8) 0%, rgba(99, 102, 241, 0) 70%);
  top: -10%;
  left: -5%;
  animation-duration: 20s;
}

.blob-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.7) 0%, rgba(168, 85, 247, 0) 70%);
  bottom: -10%;
  right: -5%;
  animation-duration: 28s;
  animation-delay: -5s;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.65) 0%, rgba(20, 184, 166, 0) 70%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 24s;
  animation-delay: -10s;
}

@keyframes float-around {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33% { transform: translate(80px, -60px) scale(1.15) rotate(120deg); }
  66% { transform: translate(-50px, 70px) scale(0.9) rotate(240deg); }
  100% { transform: translate(0, 0) scale(1) rotate(360deg); }
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 16px;
  transition: var(--transition-smooth);
}

.glass-panel-hover:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 12px 40px 0 rgba(99, 102, 241, 0.12), var(--glass-shadow);
  transform: translateY(-2px);
}

.glass-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  transition: var(--transition-smooth);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Typography & Layouts */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

h1 { font-size: 2.25rem; line-height: 2.5rem; }
p { color: var(--text-secondary); line-height: 1.6; }
a { color: rgb(129, 140, 248); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: rgb(165, 180, 252); }

/* Button & Form Controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
  gap: 0.5rem;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(135deg, rgb(99, 102, 241) 0%, rgb(168, 85, 247) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

body.light-theme .btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

body.light-theme .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.15);
}

.btn-accent {
  background: linear-gradient(135deg, rgb(20, 184, 166) 0%, rgb(13, 148, 136) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
}

.btn-accent:hover { box-shadow: 0 6px 20px rgba(20, 184, 166, 0.5); }

.btn-danger {
  background: linear-gradient(135deg, rgb(239, 68, 68) 0%, rgb(220, 38, 38) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover { box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5); }

.btn-success {
  background: linear-gradient(135deg, rgb(34, 197, 94) 0%, rgb(22, 163, 74) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
  border: none;
}

.btn-success:hover { box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5); }

.btn-orange {
  background: linear-gradient(135deg, rgb(249, 115, 22) 0%, rgb(234, 88, 12) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
  border: none;
}

.btn-orange:hover { box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5); }

.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: rgb(20, 184, 166);
  box-shadow: 0 0 15px var(--accent-glow);
}

textarea.form-control { resize: vertical; min-height: 100px; }

/* Page Layouts */
#app { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; padding: 2rem; max-width: 1400px; width: 100%; margin: 0 auto; }

/* Custom Navigation Bar Styles */
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 2rem;
  margin-top: 1rem;
  border-radius: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, rgb(165, 180, 252) 0%, rgb(216, 180, 254) 50%, rgb(153, 246, 228) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
}

body.light-theme .nav-brand {
  background: linear-gradient(135deg, rgb(79, 70, 229) 0%, rgb(147, 51, 234) 50%, rgb(13, 148, 136) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.nav-link {
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

body.light-theme .nav-link:hover, body.light-theme .nav-link.active {
  background: rgba(0, 0, 0, 0.05);
}

.nav-user { display: flex; align-items: center; gap: 0.85rem; }
.user-role-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
}
.user-role-badge.role-student {
  background: rgba(20, 184, 166, 0.1);
  color: rgb(45, 212, 191);
  border-color: rgba(20, 184, 166, 0.25);
}
.user-role-badge.role-teacher {
  background: rgba(168, 85, 247, 0.1);
  color: rgb(192, 132, 252);
  border-color: rgba(168, 85, 247, 0.25);
}

body.light-theme .user-role-badge.role-student {
  background: rgba(13, 148, 136, 0.06);
  color: rgb(13, 148, 136);
  border-color: rgba(13, 148, 136, 0.2);
}
body.light-theme .user-role-badge.role-teacher {
  background: rgba(126, 34, 206, 0.06);
  color: rgb(126, 34, 206);
  border-color: rgba(126, 34, 206, 0.2);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  background: linear-gradient(135deg, rgb(99, 102, 241) 0%, rgb(168, 85, 247) 100%);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
  user-select: none;
}
body.light-theme .user-avatar {
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.15);
}


/* Authentication Screen UI */
.auth-wrapper { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 120px); padding: 2rem 0; }
.auth-container { width: 100%; max-width: 480px; padding: 2.5rem; }
.auth-container .form-control,
body:not(.light-theme) .auth-container .form-control {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  -webkit-text-fill-color: #f8fafc;
  caret-color: #f8fafc;
}
.auth-password-field {
  position: relative;
}
.auth-password-field .form-control {
  padding-right: 3.25rem;
}
.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  width: 2.5rem;
  height: 2.5rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-color, #6366f1);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.12);
}
.auth-password-toggle:focus-visible {
  outline: 2px solid rgba(129, 140, 248, 0.8);
  outline-offset: 2px;
}
.auth-password-toggle:active {
  transform: translateY(-50%) scale(0.92);
}
.auth-password-toggle[aria-pressed="true"] {
  color: var(--accent-color, #6366f1);
}
.auth-password-toggle svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Accessible on/off switch for the Super Admin registration control. Keep the
   native checkbox in the DOM for keyboard and screen-reader support while
   presenting a compact sliding control in the visual UI. */
.admin-registration-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.admin-registration-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  opacity: 0;
  pointer-events: none;
}
.admin-registration-switch-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 3rem;
  height: 1.7rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.2);
  transition: background-color 180ms ease, box-shadow 180ms ease;
}
.admin-registration-switch-thumb {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.25);
  transform: translateX(0);
  transition: transform 180ms ease;
}
.admin-registration-switch input:checked + .admin-registration-switch-track {
  background: linear-gradient(135deg, #22c55e 0%, #14b8a6 100%);
  box-shadow: inset 0 1px 2px rgba(6, 78, 59, 0.2), 0 0 0 3px rgba(34, 197, 94, 0.08);
}
.admin-registration-switch input:checked + .admin-registration-switch-track .admin-registration-switch-thumb {
  transform: translateX(1.3rem);
}
.admin-registration-switch input:focus-visible + .admin-registration-switch-track {
  outline: 2px solid rgba(129, 140, 248, 0.9);
  outline-offset: 3px;
}
.admin-registration-switch input:disabled + .admin-registration-switch-track,
.admin-registration-switch input:disabled ~ span:last-child {
  cursor: wait;
  opacity: 0.6;
}
.auth-container .form-control:-webkit-autofill,
.auth-container .form-control:-webkit-autofill:hover,
.auth-container .form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #11182b inset;
  box-shadow: 0 0 0 1000px #11182b inset;
  -webkit-text-fill-color: #f8fafc;
  caret-color: #f8fafc;
}
body.light-theme .auth-container .form-control {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.16);
  color: #0f172a;
  -webkit-text-fill-color: #0f172a;
  caret-color: #0f172a;
}
body.light-theme .auth-container .form-control:-webkit-autofill,
body.light-theme .auth-container .form-control:-webkit-autofill:hover,
body.light-theme .auth-container .form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  box-shadow: 0 0 0 1000px #ffffff inset;
  -webkit-text-fill-color: #0f172a;
  caret-color: #0f172a;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .auth-tabs {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.05);
}

.auth-tab {
  text-align: center;
  padding: 0.6rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.auth-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.light-theme .auth-tab.active {
  background: rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.role-option {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

body.light-theme .role-option {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.01);
}

.role-option input { display: none; }
.role-option.active {
  border-color: rgb(99, 102, 241);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

/* Dashboard Statistics */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { padding: 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  margin-top: 0.25rem;
  background: linear-gradient(135deg, white 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .stat-value {
  background: linear-gradient(135deg, #0f172a 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-icon {
  background: rgba(255, 255, 255, 0.05);
  color: rgb(129, 140, 248);
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .stat-icon {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.04);
}

/* Dashboard Layout Columns */
.dashboard-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 1024px) { .dashboard-layout { grid-template-columns: 1fr !important; } }
.list-panel { display: flex; flex-direction: column; gap: 1rem; }

/* Test List Item */
.test-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
}

.test-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(4px);
}

.test-badge { padding: 0.25rem 0.50rem; border-radius: 6px; font-size: 0.75rem; font-weight: 700; }
.badge-reading { background: rgba(99, 102, 241, 0.15); color: rgb(165, 180, 252); border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-listening { background: rgba(20, 184, 166, 0.15); color: rgb(153, 246, 228); border: 1px solid rgba(20, 184, 166, 0.3); }
.badge-full { background: rgba(168, 85, 247, 0.15); color: rgb(216, 180, 254); border: 1px solid rgba(168, 85, 247, 0.3); }

/* Student Test Engine Layout */
.test-runner-container { display: flex; flex-direction: column; height: calc(100vh - 140px); gap: 1.5rem; }
.test-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; gap: 1rem; }
.header-title-area { flex: 0 1 auto; }
.progress-container { flex: 1; margin: 0 2rem; }
.header-actions-area { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.progress-meta { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--text-secondary); }
.progress-bar-bg { height: 8px; background: rgba(255, 255, 255, 0.05); border-radius: 4px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.05); }
body.light-theme .progress-bar-bg { background: rgba(0, 0, 0, 0.06); border-color: rgba(0, 0, 0, 0.02); }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, rgb(99, 102, 241) 0%, rgb(20, 184, 166) 100%); border-radius: 4px; transition: width 0.3s ease-out; }
.timer-box { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; padding: 0.5rem 1rem; border-radius: 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); }
body.light-theme .timer-box { background: rgba(0, 0, 0, 0.03); border-color: rgba(0, 0, 0, 0.05); }
.timer-warning { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.4); color: rgb(248, 113, 113); animation: pulse 1s infinite alternate; }

/* Split-Screen Workspace */
.test-workspace { display: grid; grid-template-columns: 1.1fr 1fr; flex: 1; gap: 1.5rem; min-height: 0; }
@media (max-width: 900px) { .test-workspace { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; } }
.workspace-left { overflow-y: auto; padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; height: 100%; }
.workspace-right { overflow-y: auto; padding: 2rem; height: 100%; display: flex; flex-direction: column; gap: 1.75rem; }

/* Custom layout variants */
.test-workspace.part-5-layout { grid-template-columns: 1fr; }
.test-workspace.listening-compact-layout { grid-template-columns: 340px 1fr; }
@media (min-width: 901px) {
  .test-workspace.part-1-layout,
  .test-workspace.part-2-layout {
    grid-template-columns: 1fr 1fr !important;
  }
}
.workspace-left.compact-padding { padding: 1.25rem; gap: 1rem; }

/* Drag Resizable Columns */
@media (min-width: 901px) {
  .test-workspace.resizable-active {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 0 !important;
  }
  .test-workspace.resizable-active .workspace-left {
    flex-shrink: 0 !important;
    min-width: 25% !important;
    max-width: 75% !important;
  }
  .test-workspace.resizable-active .workspace-right {
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    width: 0 !important;
  }
  .workspace-resizer {
    width: 8px;
    background: rgba(255, 255, 255, 0.08);
    cursor: col-resize;
    transition: background-color 0.2s;
    align-self: stretch;
    z-index: 100;
    flex-shrink: 0;
    position: relative;
  }
  .workspace-resizer::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1px;
    transition: background-color 0.2s;
  }
  .workspace-resizer:hover, .workspace-resizer.dragging {
    background: #db2777 !important;
  }
  .workspace-resizer:hover::after, .workspace-resizer.dragging::after {
    background: #ffffff !important;
  }
  body.light-theme .workspace-resizer {
    background: rgba(0, 0, 0, 0.04);
  }
  body.light-theme .workspace-resizer::after {
    background: rgba(0, 0, 0, 0.12);
  }
}
@media (max-width: 900px) {
  .test-workspace.resizable-active {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 1rem !important;
  }
  .test-workspace.resizable-active .workspace-left,
  .test-workspace.resizable-active .workspace-right {
    width: 100% !important;
  }
  .workspace-resizer {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .test-runner-container { height: auto; gap: 1rem; }
  .test-workspace { grid-template-columns: 1fr !important; grid-template-rows: auto auto !important; height: auto; gap: 1rem; }
  .test-workspace.part-5-layout { grid-template-columns: 1fr !important; grid-template-rows: auto !important; }
  .test-workspace.listening-compact-layout { grid-template-columns: 1fr !important; grid-template-rows: auto auto !important; }
  .workspace-left, .workspace-right { height: auto !important; overflow-y: visible !important; padding: 1.25rem 1rem !important; }
  
  .test-header { flex-direction: column; align-items: stretch; padding: 1rem; gap: 1rem; }
  .progress-container { margin: 0; width: 100%; }
  .header-actions-area { display: flex; justify-content: space-between; align-items: center; width: 100%; flex-wrap: wrap; gap: 0.5rem; }
  
  .navigation-bubble-sheet {
    position: sticky;
    bottom: 0.5rem;
    z-index: 100;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    padding: 0.75rem 1rem;
  }
  body.light-theme .navigation-bubble-sheet {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  }
  
  main { padding: 1rem 0.5rem; }
  .nav-container { margin: 0.5rem; padding: 0.75rem 1rem; }
  .option-label { padding: 0.75rem 1rem; font-size: 0.9rem; }
  .audio-player-card { padding: 0.75rem; gap: 0.75rem; }

  /* Mobile Tab Switcher for reading section */
  .mobile-workspace-tabs {
    display: flex !important;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  .mobile-tab-btn {
    flex: 1;
    padding: 0.6rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
  }
  .mobile-tab-btn.active {
    background: linear-gradient(135deg, rgb(99,102,241), rgb(168,85,247)) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
  }
  body.light-theme .mobile-tab-btn {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.08);
  }
  body.light-theme .mobile-tab-btn.active {
    background: linear-gradient(135deg, rgb(99,102,241), rgb(168,85,247)) !important;
    color: white !important;
  }
  .test-workspace.mobile-active-passage .workspace-right {
    display: none !important;
  }
  .test-workspace.mobile-active-questions .workspace-left {
    display: none !important;
  }

  /* High contrast glass fallback on mobile for better legibility */
  .glass-panel {
    background: rgba(15, 23, 42, 0.94) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
  }
  body.light-theme .glass-panel {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
  }

  /* Mobile Touch Targets expansion */
  .exam-access-toggle {
    width: 24px !important;
    height: 24px !important;
    margin-right: 0.5rem;
  }
  .draggable-chapter, .draggable-lesson {
    padding: 1.5rem 1.25rem !important;
  }
  .focus-part-checkbox {
    width: 20px !important;
    height: 20px !important;
  }

  /* Responsiveness overrides for header */
  .nav-links {
    display: none !important;
  }
  .nav-user {
    display: none !important;
  }
  .mobile-menu-toggle-btn {
    display: block !important;
  }
  .nav-container {
    margin: 0.5rem 1rem !important;
    padding: 0.75rem 1.25rem !important;
    position: relative; /* Anchor for absolute dropdown placement */
  }
}

/* Mobile dropdown container styles */
.mobile-menu-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.mobile-dropdown-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 110%;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  transform-origin: top center;
  animation: slideDownFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.light-theme .mobile-dropdown-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.05);
}
body.light-theme .mobile-nav-link:hover, body.light-theme .mobile-nav-link.active {
  background: rgba(0, 0, 0, 0.05);
}

/* Readability Variant for Reading Passages (Part 7) */
.passage-readability-card {
  background-color: var(--read-bg) !important;
  border: 1px solid var(--read-border) !important;
  color: #e2e8f0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
  font-size: 1.05rem;
  line-height: 1.75;
}

body.light-theme .passage-readability-card {
  color: #1e293b !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}

.passage-readability-card h2, .passage-readability-card h3, .passage-readability-card h4 {
  color: white !important;
  font-family: 'Playfair Display', Georgia, serif;
}

body.light-theme .passage-readability-card h2, 
body.light-theme .passage-readability-card h3, 
body.light-theme .passage-readability-card h4 {
  color: #0f172a !important;
}

.passage-content { white-space: pre-wrap; font-family: inherit; margin-top: 1rem; }
.part-label { align-self: flex-start; background: rgba(255, 255, 255, 0.08); padding: 0.35rem 0.75rem; border-radius: 6px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
body.light-theme .part-label { background: rgba(0, 0, 0, 0.06); }

/* Photo & Audio Player */
.photo-container { width: 100%; max-height: 320px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.08); display: flex; justify-content: center; align-items: center; background: rgba(0, 0, 0, 0.2); }
body.light-theme .photo-container { border-color: rgba(0,0,0,0.08); background: rgba(0, 0, 0, 0.05); }
.photo-img { max-width: 100%; max-height: 320px; object-fit: contain; }
.audio-player-card { padding: 1rem; display: flex; align-items: center; gap: 1rem; background: rgba(255, 255, 255, 0.03); border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.05); }
.audio-controls { flex: 1; }

/* Question Options selection Styling */
.question-block {
  padding: 1.5rem !important;
  margin-bottom: 1.25rem !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.3s ease !important;
}
body.light-theme .question-block {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}
.option-group { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }
.option-wrapper { position: relative; }
.option-input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.option-label { display: flex; align-items: center; padding: 0.95rem 1.25rem; border-radius: 10px; background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.06); cursor: pointer; transition: var(--transition-smooth); font-weight: 500; gap: 1rem; }
.option-label:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.15); }
.option-input:checked + .option-label { background: rgba(99, 102, 241, 0.15); border-color: rgb(99, 102, 241); box-shadow: 0 0 15px rgba(99, 102, 241, 0.15); color: white; }
.option-letter { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.85rem; font-weight: 700; transition: var(--transition-fast); }
.option-input:checked + .option-label .option-letter { background: rgb(99, 102, 241); border-color: rgb(99, 102, 241); color: white; }

/* Bubble Navigation Sheet */
.navigation-bubble-sheet { padding: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bubbles-grid { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.5rem 0; flex: 1; }
.bubble-btn { display: flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; border-radius: 50%; font-weight: 700; font-size: 0.85rem; cursor: pointer; background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.05); color: var(--text-secondary); transition: var(--transition-fast); position: relative; }
.bubble-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.12); color: var(--text-primary); }
.bubble-btn.active { border-color: rgb(99, 102, 241); color: rgb(129, 140, 248); box-shadow: 0 0 10px rgba(99, 102, 241, 0.2); }
.bubble-btn.answered { background: rgba(20, 184, 166, 0.15); border-color: rgb(20, 184, 166); color: rgb(20, 184, 166); }
.bubble-btn.flagged { border-color: rgb(234, 179, 8); }
.bubble-btn.flagged::after { content: '🚩'; position: absolute; top: -4px; right: -4px; font-size: 0.65rem; }

/* Flag & Review Actions */
.review-actions { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
body.light-theme .review-actions { border-color: rgba(0, 0, 0, 0.05); }
.flag-toggle-btn { display: inline-flex; align-items: center; gap: 0.4rem; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: var(--transition-fast); }
.flag-toggle-btn:hover, .flag-toggle-btn.flagged { color: rgb(234, 179, 8); }

/* Test Review & Score Screen */
.results-header { text-align: center; padding: 2rem 0; }
.score-circle-container { display: flex; justify-content: center; gap: 2rem; margin: 2rem 0; }
.score-circle { width: 140px; height: 140px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.05); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }
body.light-theme .score-circle { border-color: rgba(0,0,0,0.05); }
.score-circle-listening { border-color: rgba(20, 184, 166, 0.3); background: radial-gradient(circle, rgba(20, 184, 166, 0.1) 0%, transparent 80%); }
.score-circle-reading { border-color: rgba(99, 102, 241, 0.3); background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 80%); }
.score-circle-total { border-color: rgba(168, 85, 247, 0.4); background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 80%); }
.score-circle-value { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.score-circle-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-top: 0.25rem; }

/* Correct/Incorrect Option Review Styles */
.option-wrapper-correct .option-label { border-color: rgb(34, 197, 94) !important; background: rgba(34, 197, 94, 0.15) !important; color: white !important; }
body.light-theme .option-wrapper-correct .option-label { color: rgb(21, 128, 61) !important; }
.option-wrapper-correct .option-letter { background: rgb(34, 197, 94) !important; border-color: rgb(34, 197, 94) !important; color: white !important; }
.option-wrapper-incorrect .option-label { border-color: rgb(239, 68, 68) !important; background: rgba(239, 68, 68, 0.15) !important; color: white !important; }
body.light-theme .option-wrapper-incorrect .option-label { color: rgb(185, 28, 28) !important; }
.option-wrapper-incorrect .option-letter { background: rgb(239, 68, 68) !important; border-color: rgb(239, 68, 68) !important; color: white !important; }
.explanation-box { background: rgba(255, 255, 255, 0.03); border-left: 4px solid rgb(99, 102, 241); padding: 1rem; border-radius: 0 8px 8px 0; margin-top: 1rem; }
body.light-theme .explanation-box { border-left-color: rgb(79, 70, 229); }

/* Structured detailed explanations, especially Listening Part 1 answer keys. */
.formatted-explanation {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.45rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.formatted-explanation-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.formatted-explanation-heading {
  color: var(--text-primary);
  font-weight: 800;
  line-height: 1.4;
}
.formatted-explanation-section p {
  margin: 0;
}
.formatted-explanation-answer {
  padding: 0.45rem 0.65rem;
  border-radius: 7px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.18);
  color: var(--text-primary);
  font-weight: 700;
}
.formatted-explanation-correct {
  color: #15803d !important;
  font-weight: 800;
}
.formatted-explanation-options {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.formatted-explanation-option {
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(148, 163, 184, 0.14);
}
.formatted-explanation-option strong {
  color: var(--text-primary);
  margin-right: 0.25rem;
}
.formatted-explanation-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  padding-left: 1.25rem;
}
.formatted-explanation-list li::marker {
  color: rgb(99, 102, 241);
  font-weight: 800;
}
body.light-theme .formatted-explanation-option {
  background: rgba(15, 23, 42, 0.025);
  border-color: rgba(100, 116, 139, 0.18);
}

/* Table configurations */
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
body.light-theme th, body.light-theme td { border-bottom-color: rgba(0, 0, 0, 0.06); }
th { color: var(--text-secondary); font-weight: 700; text-align: left; }

.premium-table {
  width: 100%;
  border-collapse: collapse;
}
.premium-table th {
  font-family: 'Outfit', var(--font-sans);
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.85rem 0.5rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}
body.light-theme .premium-table th {
  border-bottom-color: rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
}
.premium-table td {
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background-color 0.15s ease;
  vertical-align: middle;
}
body.light-theme .premium-table td {
  border-bottom-color: rgba(0, 0, 0, 0.03);
}
.premium-table tbody tr {
  transition: all 0.15s ease;
}
.premium-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}
body.light-theme .premium-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.012);
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.01); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 4px; }
body.light-theme ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.1); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }
body.light-theme ::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.2); }

.chart-container { position: relative; width: 100%; height: 100%; min-height: 250px; }

/* Skeletons */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skeleton-sweep 1.5s infinite;
  border-radius: 8px;
}
body.light-theme .skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.02) 25%, rgba(0,0,0,0.06) 50%, rgba(0,0,0,0.02) 75%);
  background-size: 200% 100%;
}
.skeleton-text { height: 16px; margin-bottom: 0.5rem; width: 100%; }
.skeleton-title { height: 24px; margin-bottom: 1rem; width: 60%; }
@keyframes skeleton-sweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulse {
  0% { opacity: 0.9; box-shadow: 0 0 5px rgba(239, 68, 68, 0.2); }
  100% { opacity: 1; box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }
}

/* Floating controls */
.floating-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.control-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.95rem;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

body.light-theme .control-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}
body.light-theme .control-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
}
.nav-redeem-license-btn {
  width: auto;
  min-width: 108px;
  padding: 0 0.65rem;
  gap: 0.35rem;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.32);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}
.nav-redeem-license-btn:hover {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.24);
  border-color: rgba(129, 140, 248, 0.55);
}
.nav-redeem-license-btn svg {
  width: 15px;
  height: 15px;
  margin: 0 !important;
  flex: 0 0 auto;
}
body.light-theme .nav-redeem-license-btn {
  color: #4338ca;
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(79, 70, 229, 0.25);
}
body.light-theme .nav-redeem-license-btn:hover {
  color: #3730a3;
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(79, 70, 229, 0.4);
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Filter pills for Exam Library */
.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.15rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  transition: var(--transition-smooth);
  user-select: none;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.filter-pill.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
  border-color: rgb(168, 85, 247);
  color: rgb(216, 180, 254);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

/* Light Theme override for filter pills */
body.light-theme .filter-pill {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
}

body.light-theme .filter-pill:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
}

body.light-theme .filter-pill.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
  border-color: rgb(168, 85, 247);
  color: rgb(109, 40, 217);
  box-shadow: none;
}

/* Custom Tooltip Styles for Graduation Cap review links */
.tooltip-container {
  position: relative;
}

.custom-tooltip {
  visibility: hidden;
  width: 200px;
  background-color: rgba(15, 23, 42, 0.95);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 6px 10px;
  position: absolute;
  z-index: 100;
  bottom: 125%; /* Position above the button */
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Tooltip arrow */
.custom-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

.tooltip-container:hover .custom-tooltip {
  visibility: visible;
  opacity: 1;
}

/* Light Theme overrides for tooltips */
body.light-theme .custom-tooltip {
  background-color: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.light-theme .custom-tooltip::after {
  border-color: rgba(255, 255, 255, 0.98) transparent transparent transparent;
}

/* Compact Audio Player and Status Animations */
.compact-audio-player {
  padding: 0.75rem 1rem !important;
  gap: 0.75rem !important;
  min-height: 52px;
}

.audio-status-anim {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-color);
  border-radius: 50%;
  display: inline-block;
  animation: audioPulse 1.2s infinite alternate ease-in-out;
  box-shadow: 0 0 8px var(--accent-color);
}

@keyframes audioPulse {
  0% {
    transform: scale(0.7);
    opacity: 0.4;
  }
  100% {
    transform: scale(1.3);
    opacity: 1;
    box-shadow: 0 0 12px var(--accent-color);
  }
}

/* Flagged navigation bubble overrides */
.bubble-btn.flagged {
  background: rgba(234, 179, 8, 0.15) !important;
  border-color: rgb(234, 179, 8) !important;
  color: rgb(234, 179, 8) !important;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.2) !important;
}
.bubble-btn.flagged:hover {
  background: rgba(234, 179, 8, 0.25) !important;
  border-color: rgb(234, 179, 8) !important;
  color: rgb(234, 179, 8) !important;
}

body.light-theme .bubble-btn.flagged {
  background: rgba(234, 179, 8, 0.12) !important;
  border-color: rgb(202, 138, 4) !important;
  color: rgb(161, 98, 7) !important;
  box-shadow: none !important;
}
body.light-theme .bubble-btn.flagged:hover {
  background: rgba(234, 179, 8, 0.2) !important;
}

/* Typography & Spacing Enhancements (Intense Reading Mode) */
.passage-content {
  font-family: var(--font-sans) !important;
  line-height: 1.8 !important;
  font-size: 1.05rem !important;
  color: #f8fafc !important; /* bright crisp slate-white */
  letter-spacing: 0.015em !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.light-theme .passage-content {
  color: #1e293b !important; /* high-contrast deep grey */
}

.question-block p {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1.55 !important;
  margin-bottom: 0.95rem !important;
  letter-spacing: -0.01em !important;
}

body.light-theme .question-block p {
  color: #0f172a !important; /* deep high-contrast slate */
}

.option-label {
  padding: 0.85rem 1.15rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  font-size: 0.9rem !important;
  color: var(--text-secondary) !important;
  transition: all 0.15s ease-in-out !important;
}

body.light-theme .option-label {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #334155 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
}

body.light-theme .option-label:hover {
  background: rgba(0, 0, 0, 0.02) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
}

/* Perfectly align radio check styling */
.option-input:checked + .option-label {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: rgb(99, 102, 241) !important;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15) !important;
  color: #ffffff !important;
}

body.light-theme .option-input:checked + .option-label {
  background: rgba(99, 102, 241, 0.08) !important;
  border-color: rgb(79, 70, 229) !important;
  color: rgb(67, 56, 202) !important;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.1) !important;
}

/* Test Mode Segment Control inside Exam Library */
.test-mode-segment-control {
  display: flex;
  background: rgba(0, 0, 0, 0.15);
  padding: 2px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
body.light-theme .test-mode-segment-control {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.03);
}

.mode-seg-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.mode-seg-btn:hover {
  color: var(--text-primary);
}
.mode-seg-btn.active {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
body.light-theme .mode-seg-btn.active {
  background: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.part-select-pill {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}
.part-select-pill.active {
  border-color: rgba(20, 184, 166, 0.4) !important;
  background: rgba(20, 184, 166, 0.15) !important;
  color: rgb(45, 212, 191) !important;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.1);
}
body.light-theme .part-select-pill {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  color: #475569;
}
body.light-theme .part-select-pill.active {
  background: rgba(20, 184, 166, 0.08) !important;
  border-color: rgb(13, 148, 136) !important;
  color: rgb(13, 148, 136) !important;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}/* 7-Parts Progress Bars and Gamified AI Score Pointer Styling */
.fill-listening {
  background: linear-gradient(90deg, #38bdf8, #0284c7);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}
.fill-reading {
  background: linear-gradient(90deg, #f472b6, #db2777);
  box-shadow: 0 0 10px rgba(244, 114, 182, 0.25);
}
.text-listening {
  color: #38bdf8;
}
.text-reading {
  color: #f472b6;
}
body.light-theme .text-listening {
  color: #0369a1;
}
body.light-theme .text-reading {
  color: #be185d;
}

/* Dashboard Highlight Cards & Gamified Score Slider Pointer */
.dashboard-highlight-card {
  padding: 2.25rem;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 285px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme .dashboard-highlight-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.02);
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.06);
}

.dashboard-highlight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 48px -8px rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.08);
}

body.light-theme .dashboard-highlight-card:hover {
  box-shadow: 0 24px 48px -10px rgba(15, 23, 42, 0.1);
  border-color: rgba(15, 23, 42, 0.05);
}

/* Gamified AI Predict Pointer */
.gamified-pointer-wrap {
  position: relative;
  padding: 12px 0;
}
.gamified-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  position: relative;
}
body.light-theme .gamified-track {
  background: rgba(0, 0, 0, 0.06);
}
.gamified-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
  transition: width 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}
.gamified-pointer {
  position: absolute;
  top: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #10b981;
  border: 3.5px solid #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.7);
  transition: left 1.2s cubic-bezier(0.19, 1, 0.22, 1);
  z-index: 5;
  cursor: pointer;
  animation: pointerPulse 2s infinite;
}
body.light-theme .gamified-pointer {
  border: 3.5px solid #ffffff;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.5);
}

@keyframes pointerPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7), 0 4px 12px rgba(16, 185, 129, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(16, 185, 129, 0), 0 4px 12px rgba(16, 185, 129, 0.5);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0), 0 4px 12px rgba(16, 185, 129, 0.5);
  }
}

/* Secondary Button Outline style */
.btn-orange-outline {
  background: transparent !important;
  color: #ea580c !important;
  border: 2px solid #ea580c !important;
  box-shadow: none !important;
  transition: all 0.2s ease-in-out;
}
.btn-orange-outline:hover {
  background: rgba(234, 88, 12, 0.08) !important;
  color: #ea580c !important;
  box-shadow: 0 0 12px rgba(234, 88, 12, 0.15) !important;
}
body.light-theme .btn-orange-outline {
  border-color: #ea580c !important;
  color: #ea580c !important;
}
body.light-theme .btn-orange-outline:hover {
  background: rgba(234, 88, 12, 0.05) !important;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE NAVBAR & MOBILE VIEW OPTIMIZATIONS (THUMB-ZONE)
   ══════════════════════════════════════════════════════════ */

/* --- SECTION 1.1: Desktop Medium Screens (1024px - 1200px) --- */
@media (max-width: 1200px) and (min-width: 1024px) {
  .nav-links {
    gap: 0.75rem !important;
  }
  .nav-link {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.6rem !important;
    gap: 0.4rem !important;
  }
  .nav-user {
    gap: 0.5rem !important;
  }
  .nav-user > span {
    display: none !important; /* Hide full username to save space */
  }
  #logout-btn {
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0 !important; /* Hide "Sign Out" text */
    flex-shrink: 0 !important;
  }
  #logout-btn::before {
    content: '🚪' !important;
    font-size: 1.15rem !important;
    display: inline-block;
  }
}

/* --- SECTION 1.2: Tablet and Mobile Screens (< 1024px) --- */
@media (max-width: 1023px) {
  .nav-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.5rem 1rem !important;
    gap: 0.5rem !important;
  }
  .nav-brand {
    font-size: 1.25rem !important;
    flex-shrink: 0 !important;
  }
  .nav-links {
    display: none !important; /* Hide original navigation link list */
  }
  .nav-user {
    display: flex !important; /* Keep container visible to host bell & avatar */
    align-items: center !important;
    gap: 0.6rem !important;
    margin-left: auto !important; /* Push it to the right */
    margin-right: 0.6rem !important;
    flex-shrink: 0 !important;
  }
  /* Hide unnecessary elements on mobile main navbar */
  .nav-user .user-role-badge,
  .nav-user .floating-controls,
  .nav-user #logout-btn {
    display: none !important;
  }
  /* Keep avatar and bell visible */
  .nav-user .user-avatar,
  .nav-user .nav-notification-bell {
    display: flex !important;
  }
  /* Shorten name/truncate to prevent overflow */
  .nav-user > span {
    display: inline-block !important;
    max-width: 80px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.85rem !important;
  }
  .mobile-menu-toggle-btn {
    display: flex !important; /* Ensure hamburger button is visible */
    align-items: center !important;
    justify-content: center !important;
    order: 10 !important; /* Position it on the far right */
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
  }
}

/* --- SECTION 2: Mobile Specific Overrides (< 768px) --- */
@media (max-width: 767px) {
  /* 2.1: Typography & Spacing Optimization */
  h1, .welcome-title, .dashboard-title {
    font-size: 1.35rem !important; /* Downscale headers to 1.25rem - 1.5rem */
    line-height: 1.25 !important;
    letter-spacing: -0.01em !important;
  }
  h2, .section-title, .sec {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
  }
  
  /* Reduce Card Padding to 12px or 16px to prevent scroll fatigue */
  .glass-panel, 
  .card, 
  .glass-card, 
  .stat-card, 
  .passage-readability-card, 
  .audio-player-card, 
  .dashboard-highlight-card {
    padding: 14px !important; /* Balanced padding inside stats cards */
    border-radius: 16px !important;
  }
  
  /* 2.2: Touch Targets (Fat Finger Prevention) & Margin Spacing */
  .btn, 
  .control-btn, 
  .filter-pill, 
  .part-select-pill,
  .option-label,
  .mobile-nav-link,
  .icon-btn,
  .bubble-btn,
  select,
  input[type="button"],
  input[type="submit"] {
    min-height: 48px !important; /* Touch target min 48px per guidelines */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
  
  .btn {
    padding: 0.75rem 1.25rem !important;
  }

  /* Vertical elements margin spacing (12px to 16px) */
  .card, 
  .glass-panel, 
  .glass-card, 
  .stat-card, 
  .passage-readability-card, 
  .audio-player-card, 
  .dashboard-highlight-card, 
  .option-wrapper, 
  .mobile-dropdown-links li,
  .mobile-nav-link {
    margin-bottom: 12px !important;
  }

  /* 2.3: TOEIC Exam Options vertical rendering (100% width, single column) */
  .option-group {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 12px !important;
  }
  .option-wrapper {
    width: 100% !important;
    margin-bottom: 0 !important;
  }
  .option-label {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 12px 16px 12px 12px !important; /* Reduced left padding to 12px */
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    transition: all 0.2s ease !important;
  }
  body.light-theme .option-label {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: var(--text-sec) !important;
  }
  .option-input:checked + .option-label {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgb(99, 102, 241) !important;
    color: white !important;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15) !important;
  }
  body.light-theme .option-input:checked + .option-label {
    background: rgba(79, 70, 229, 0.1) !important;
    border-color: rgb(79, 70, 229) !important;
    color: rgb(79, 70, 229) !important;
  }
  
  /* 2.4: Symmetry and Symmetry adjustments on Mobile */
  .dashboard-highlight-card > div:first-child {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1.5rem !important;
  }
  .dashboard-highlight-card > div:first-child > div:first-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }
}

/* ==========================================================================
   STUDENT SIDEBAR NAVIGATION — ICON-TOP, COMPACT (80px) STYLE
   ========================================================================== */

/* ── Sidebar width variable ── */
:root { --sidebar-w: 80px; }

/* Grid Layout */
body.student-sidebar-layout #app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Fixed narrow sidebar ── */
body.student-sidebar-layout #app-header {
  grid-column: 1;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--glass-bg);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0 1rem;
  box-sizing: border-box;
}

/* ── Main content area — snug to sidebar ── */
body.student-sidebar-layout #app-main {
  grid-column: 2;
  padding: 1rem 1.5rem 3rem 1.5rem;
  margin-left: 0;
  width: auto;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

/* ── Brand logo (icon only) ── */
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgb(165,180,252) 0%, rgb(216,180,254) 50%, rgb(153,246,228) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 0;
}
.sidebar-brand-text { display: none; }  /* hide text label */

body.light-theme .sidebar-brand {
  background: linear-gradient(135deg, rgb(79,70,229) 0%, rgb(147,51,234) 50%, rgb(13,148,136) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Menu list: vertical stack of icon+label items ── */
.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
}

/* ── Each menu item: icon on top, label below ── */
.sidebar-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: 72px;
  padding: 0.5rem 0.25rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.01em;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  text-align: center;
  box-sizing: border-box;
}
.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  /* override old inline margin-right */
  margin-right: 0 !important;
  vertical-align: 0 !important;
}
.sidebar-link span.sidebar-label {
  line-height: 1.15;
  width: 100%;
  max-width: 72px;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow: visible;
  text-align: center;
  display: block;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
body.light-theme .sidebar-link:hover {
  background: rgba(0,0,0,0.05);
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.18) 0%, rgba(168,85,247,0.12) 100%);
  border: 1px solid rgba(99,102,241,0.35);
  color: #a5b4fc;
}
body.light-theme .sidebar-link.active {
  background: linear-gradient(135deg, rgba(79,70,229,0.1) 0%, rgba(147,51,234,0.06) 100%);
  border-color: rgba(79,70,229,0.25);
  color: rgb(79,70,229);
}

/* ── NEW badge — reposition for narrow sidebar ── */
.vocab-badge-new {
  position: absolute;
  top: 4px; right: 4px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: white;
  font-size: 0.5rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 5px;
  letter-spacing: 0.05em;
}

/* ── Premium card — compact for narrow sidebar ── */
.sidebar-premium-card {
  margin-top: auto;
  margin-bottom: 0.75rem;
  width: 60px;
  background: linear-gradient(135deg, rgba(99,102,241,0.18) 0%, rgba(168,85,247,0.18) 100%);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.65rem 0.4rem;
  border-radius: 14px;
  text-align: center;
  overflow: hidden;
}
body.light-theme .sidebar-premium-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.07) 0%, rgba(168,85,247,0.07) 100%);
  border-color: rgba(99,102,241,0.15);
}
.sidebar-premium-card .diamond-icon {
  font-size: 1.3rem;
  display: block;
  margin-bottom: 0.25rem;
  filter: drop-shadow(0 0 6px rgba(99,102,241,0.5));
}
.sidebar-premium-card .premium-card-text { display: none; } /* hide text in narrow mode */
.premium-upgrade-btn {
  width: 100%;
  height: 26px;
  border-radius: 8px;
  background: var(--text-primary);
  color: var(--bg-base);
  border: none;
  font-weight: 800;
  font-size: 0.55rem;
  cursor: pointer;
  transition: var(--transition-fast);
}
.premium-upgrade-btn:hover { transform: translateY(-1px); }
body.light-theme .premium-upgrade-btn { background: rgb(79,70,229); color: white; }

/* ── Logout button (icon only in narrow mode) ── */
.sidebar-logout-wrap {
  width: 60px;
  margin-bottom: 0.5rem;
}
.sidebar-logout-wrap .btn {
  width: 100%;
  border-radius: 12px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0;  /* hide text */
}
.sidebar-logout-wrap .btn svg { margin: 0; }
.sidebar-logout-label { display: none; }

/* ── Topbar ── */
.topbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  width: 100%;
  max-width: 1360px;
  padding: 0 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 16px;
  margin: 0 auto 1.5rem;
  transition: var(--transition-smooth);
}

#page-content-wrapper {
  width: 100%;
  min-width: 0;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar-left-brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
}
.topbar-left-brand svg {
  stroke: rgb(99, 102, 241);
}
body.light-theme .topbar-left-brand svg {
  stroke: rgb(79, 70, 229);
}
.mobile-brand-text {
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, rgb(165,180,252) 0%, rgb(216,180,254) 50%, rgb(153,246,228) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.light-theme .mobile-brand-text {
  background: linear-gradient(135deg, rgb(79,70,229) 0%, rgb(147,51,234) 50%, rgb(13,148,136) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar-left-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
}

/* Visibility responsive helpers */
.desktop-only {
  display: flex !important;
}
.mobile-only {
  display: none !important;
}

/* ── Dashboard grid util classes ── */
.dashboard-grid-mockup {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}
.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }

/* ═══════════════════════════════════════════
   MOBILE — Bottom Navigation Bar
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .col-8, .col-4, .col-3, .col-6 { grid-column: span 12; }

  /* Hide sidebar on mobile */
  #app,
  body.student-sidebar-layout #app {
    grid-template-columns: 1fr !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  #app-topbar,
  body.student-sidebar-layout #app-topbar {
    display: none !important;
  }

  /* Show and position topbar header on mobile */
  .topbar-container,
  body.student-sidebar-layout .topbar-container {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    height: calc(52px + env(safe-area-inset-top, 0px)) !important;
    background: rgba(15, 23, 42, 0.93) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    margin-bottom: 0 !important;
    z-index: 200 !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    border-radius: 0 !important; /* Reset border radius on mobile */
  }
  body.light-theme .topbar-container,
  body.light-theme body.student-sidebar-layout .topbar-container {
    background: rgba(255, 255, 255, 0.94) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
  }
  .topbar-left-brand {
    display: flex !important;
  }
  .topbar-right {
    gap: 0.45rem !important;
  }
  .topbar-right .control-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
  }
  .topbar-right .nav-redeem-license-btn {
    width: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    font-size: 0.85rem !important;
  }
  .topbar-right .nav-redeem-license-btn .nav-redeem-label {
    display: none !important;
  }
  .topbar-right .user-avatar,
  .topbar-right > span {
    display: none !important;
  }
  .topbar-right #nav-mobile-logout {
    display: flex !important;
    width: 34px !important;
    height: 34px !important;
  }
  
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
  }
  
  @media (max-width: 400px) {
    .mobile-brand-text {
      display: none !important;
    }
  }
  body.student-sidebar-layout #app-header {
    /* Transform into bottom nav */
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 0 0.5rem env(safe-area-inset-bottom, 0px) !important;
    border-right: none !important;
    border-top: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    z-index: 200 !important;
  }

  /* Hide brand, premium card, logout in bottom nav */
  body.student-sidebar-layout #app-header .sidebar-brand,
  body.student-sidebar-layout #app-header .sidebar-premium-card,
  body.student-sidebar-layout #app-header .sidebar-logout-wrap {
    display: none !important;
  }

  /* Menu becomes horizontal bottom bar */
  body.student-sidebar-layout #app-header .sidebar-menu {
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    width: 100% !important;
    gap: 2px !important;
  }
  body.student-sidebar-layout #app-header .sidebar-menu li {
    flex: 1;
    display: flex;
    justify-content: center;
  }
  body.student-sidebar-layout #app-header .sidebar-link {
    width: 100% !important;
    padding: 0.35rem 0.1rem !important;
    font-size: 0.64rem !important;
    border-radius: 8px !important;
    gap: 0.15rem !important;
  }
  body.student-sidebar-layout #app-header .sidebar-link span.sidebar-label {
    font-size: 0.62rem !important;
    line-height: 1.1 !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    overflow: visible !important;
    display: block !important;
  }
  body.student-sidebar-layout #app-header .sidebar-link svg {
    width: 18px !important;
    height: 18px !important;
  }

  /* Main content — add bottom padding for nav bar */
  #app-main,
  body.student-sidebar-layout #app-main {
    grid-column: 1 !important;
    margin-left: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: calc(52px + env(safe-area-inset-top, 0px) + 0.75rem) 0.875rem calc(88px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: hidden !important;
  }

  body.student-sidebar-layout #app-main > * {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .db-main-column,
  body.student-sidebar-layout .db-main-column {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body.student-sidebar-layout .db-card,
  body.student-sidebar-layout .score-card {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body.student-sidebar-layout .score-card .score-main-row {
    align-items: flex-start !important;
  }

  body.student-sidebar-layout .score-card .score-band {
    width: 100% !important;
    margin-left: 0 !important;
  }

  body.student-sidebar-layout .score-card .score-band span {
    display: inline-flex !important;
    max-width: 100% !important;
    white-space: normal !important;
    line-height: 1.25 !important;
  }

  body.student-sidebar-layout .db-readiness-card > div:nth-child(2) {
    align-items: flex-start !important;
  }

  body.student-sidebar-layout .db-skill-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 0.35rem 0.5rem !important;
    align-items: center !important;
  }

  body.student-sidebar-layout .db-skill-row > span,
  body.student-sidebar-layout .db-skill-row > div {
    min-width: 0 !important;
  }

  body.student-sidebar-layout .db-skill-row > div {
    justify-content: flex-end !important;
    gap: 0.35rem !important;
  }

  body.student-sidebar-layout .db-skill-status {
    max-width: 4.8rem !important;
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.2 !important;
  }
}

/* Tablet: sidebar stays but slightly wider */
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-w: 80px; }
  .col-8, .col-4, .col-3 { grid-column: span 12; }
  .col-6 { grid-column: span 6; }
}

/* Custom visual polish */
.card-status-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}
.status-good { background: rgba(34, 197, 94, 0.15); color: rgb(74, 222, 128); }
.status-moderate { background: rgba(234, 179, 8, 0.15); color: rgb(253, 224, 71); }
.status-bad { background: rgba(239, 68, 68, 0.15); color: rgb(248, 113, 113); }

body.light-theme .status-good { background: rgba(34, 197, 94, 0.1); color: rgb(21, 128, 61); }
body.light-theme .status-moderate { background: rgba(234, 179, 8, 0.1); color: rgb(161, 98, 7); }
body.light-theme .status-bad { background: rgba(239, 68, 68, 0.1); color: rgb(185, 28, 28); }





/* ==========================================
   STUDENT DASHBOARD RESPONSIVE SYSTEM
   ========================================== */

/* --- Base (Desktop) Dashboard Grid Classes --- */
.db-header-row {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1.5rem;
  flex-wrap: wrap;
  width: 100%;
}

.db-row-triple {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: stretch;
  width: 100%;
}

.db-row-double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
  width: 100%;
}
.db-row-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.db-widget-inner-2col {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
}

.db-score-big {
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  font-family: var(--font-sans);
  text-shadow: 0 4px 15px rgba(0,0,0,0.25);
}

.db-greeting-name {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--text-primary), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0.25rem 0;
  line-height: 1.15;
}

.db-greeting-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1.5;
  min-width: 220px;
}

.db-canvas-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.db-canvas-wrap canvas {
  width: 100%;
  height: 100%;
}

.db-vocab-circle {
  position: relative;
  width: 95px;
  height: 95px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  flex-shrink: 0;
}

.db-vocab-circle svg {
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   UNIFIED DASHBOARD DESIGN SYSTEM TOKENS & CARD HIERARCHY
   ========================================================================== */
:root {
  --dash-brand-primary: #6366f1;
  --dash-brand-hover: #4f46e5;
  --dash-brand-subtle: rgba(99, 102, 241, 0.12);
  --dash-brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  
  --dash-success: #10b981;
  --dash-success-subtle: rgba(16, 185, 129, 0.12);
  --dash-warning: #f59e0b;
  --dash-warning-subtle: rgba(245, 158, 11, 0.12);
  --dash-critical: #ef4444;
  --dash-critical-subtle: rgba(239, 68, 68, 0.12);
  
  --dash-surface-l1: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  --dash-surface-l2: rgba(30, 41, 59, 0.8);
  --dash-surface-l3: rgba(255, 255, 255, 0.03);
  --dash-border: rgba(255, 255, 255, 0.08);
  --dash-border-strong: rgba(255, 255, 255, 0.15);
}

body.light-theme {
  --dash-surface-l1: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.95));
  --dash-surface-l2: rgba(248, 250, 252, 0.9);
  --dash-surface-l3: rgba(0, 0, 0, 0.02);
  --dash-border: rgba(0, 0, 0, 0.08);
  --dash-border-strong: rgba(0, 0, 0, 0.15);
}

/* Card Hierarchy Levels */
.card-level-1-hero {
  background: var(--dash-surface-l1) !important;
  border: 1px solid var(--dash-border-strong) !important;
  border-radius: 24px !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3) !important;
  position: relative;
  overflow: hidden;
  padding: 1.75rem !important;
}

.card-level-2-action {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%) !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  border-radius: 24px !important;
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.15) !important;
  padding: 1.75rem !important;
}

.card-level-3-analytics {
  background: var(--dash-surface-l2) !important;
  border: 1px solid var(--dash-border) !important;
  border-radius: 20px !important;
  padding: 1.5rem !important;
}

.card-level-4-supporting {
  background: var(--dash-surface-l3) !important;
  border: 1px solid var(--dash-border) !important;
  border-radius: 16px !important;
  padding: 1.25rem !important;
}

/* 12-Column Responsive Dashboard Grid */
.unified-dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  width: 100%;
}

.col-span-12 { grid-column: span 12 / span 12; }
.col-span-8  { grid-column: span 8 / span 8; }
.col-span-7  { grid-column: span 7 / span 7; }
.col-span-6  { grid-column: span 6 / span 6; }
.col-span-5  { grid-column: span 5 / span 5; }
.col-span-4  { grid-column: span 4 / span 4; }

.db-outer-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 1360px;
  margin: 0 auto;
}

/* Primary CTA Highlight */
.primary-cta-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.primary-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.5) !important;
}

/* --- Tablet Breakpoint (<=1024px) --- */
@media (max-width: 1024px) {
  .col-span-8, .col-span-4, .col-span-7, .col-span-5, .col-span-6 {
    grid-column: span 12 / span 12;
  }
}

@media (max-width: 768px) {
  .unified-dash-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  .card-level-1-hero,
  .card-level-2-action,
  .card-level-3-analytics,
  .card-level-4-supporting {
    padding: 1.25rem !important;
    border-radius: 20px !important;
  }
  .db-score-big {
    font-size: 4rem !important;
  }
  .db-greeting-name {
    font-size: 1.8rem !important;
  }
  .db-canvas-wrap {
    width: 95px;
    height: 95px;
  }
}

/* --- Mobile Landscape Breakpoint (<=768px) --- */
@media (max-width: 768px) {
  .glass-panel {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .db-row-double > div,
  .db-row-triple > div {
    min-width: 0 !important;
    width: 100% !important;
  }
  .db-header-row {
    flex-direction: column !important;
    gap: 1rem !important;
  }
  .db-greeting-col {
    min-width: unset !important;
    flex: unset !important;
  }
  .db-row-triple {
    grid-template-columns: 1fr !important;
  }
  .db-row-triple > :nth-child(3) {
    grid-column: auto;
  }
  .db-row-double {
    grid-template-columns: 1fr !important;
  }
  .db-widget-inner-2col {
    grid-template-columns: 1fr !important;
    justify-items: center;
    text-align: center;
  }
  .db-widget-inner-2col > :last-child {
    text-align: left;
    justify-self: stretch;
  }
  .db-score-big {
    font-size: 3.5rem !important;
  }
  .db-greeting-name {
    font-size: 1.6rem !important;
  }
  .db-outer-wrap {
    gap: 1.25rem !important;
  }
  .db-canvas-wrap {
    width: 90px;
    height: 90px;
    margin: 0 auto;
  }
  .db-vocab-circle {
    width: 80px;
    height: 80px;
  }
  .db-row-triple .glass-panel a,
  .db-row-triple .glass-panel button,
  .db-row-double .glass-panel a,
  .db-row-double .glass-panel button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* --- Mobile Portrait Breakpoint (<=480px) --- */
@media (max-width: 480px) {
  .db-score-big {
    font-size: 2.8rem !important;
  }
  .db-greeting-name {
    font-size: 1.35rem !important;
  }
  .db-outer-wrap {
    gap: 1rem !important;
  }
  .db-canvas-wrap {
    width: 80px;
    height: 80px;
  }
  .db-vocab-circle {
    width: 70px;
    height: 70px;
  }
  .db-row-triple .glass-panel,
  .db-row-double .glass-panel,
  .db-header-row .glass-panel {
    padding: 1rem 1.25rem !important;
  }
}

/* --- Drag and Drop Builder Styles --- */
.draggable-widget {
  cursor: grab;
  position: relative;
  transition: transform 0.2s, opacity 0.2s;
  user-select: none;
}

.draggable-widget:active {
  cursor: grabbing;
}

.draggable-widget.dragging {
  opacity: 0.4;
  transform: scale(0.97);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

.preview-drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  min-height: 120px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: background-color 0.25s, border-color 0.25s, box-shadow 0.25s;
  position: relative;
  background: rgba(255, 255, 255, 0.01);
}

.preview-drop-zone.drag-over {
  background-color: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.15);
}

.drop-zone-placeholder {
  pointer-events: none;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.widget-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  cursor: grab;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: background-color 0.2s, color 0.2s;
}

.widget-drag-handle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.widget-sidebar-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.85rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.2s;
  cursor: grab;
}

.widget-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.2);
}

.widget-sidebar-item.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

.widget-badge-status {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-pos-header { background: rgba(244, 63, 94, 0.15); color: rgb(251, 113, 133); border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-pos-top { background: rgba(99, 102, 241, 0.15); color: rgb(165, 180, 252); border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-pos-left { background: rgba(234, 179, 8, 0.15); color: rgb(253, 224, 71); border: 1px solid rgba(234, 179, 8, 0.3); }
.badge-pos-right { background: rgba(20, 184, 166, 0.15); color: rgb(153, 246, 228); border: 1px solid rgba(20, 184, 166, 0.3); }
.badge-pos-disabled { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); border: 1px solid rgba(255, 255, 255, 0.08); }


/* ==========================================================================
   MOBILE UI OPTIMIZATIONS & BALANCE REFINEMENTS
   ========================================================================== */

/* 1. Scorecard Hero Row - Stacks vertically on mobile to prevent overlapping */
.scorecard-hero-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}
@media (max-width: 600px) {
  .scorecard-hero-row {
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
    gap: 1.25rem !important;
  }
  .scorecard-hero-row > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .scorecard-badges-list {
    align-items: center !important;
  }
}

/* 2. Responsive Card Grids - Target inline-grid minmax definitions and make them stack on mobile */
@media (max-width: 600px) {
  div[style*="minmax(320px"],
  div[style*="minmax(340px"],
  div[style*="minmax(240px"] {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
}

/* 3. Part 5 Diagnostic Dashboard Grid Override */
@media (max-width: 768px) {
  .p5-db-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}

/* 4. Update Megaphone Banner Responsive Styles */
.update-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 2;
  max-width: 65%;
}
.update-banner-graphic {
  width: 80px;
  height: 80px;
  opacity: 0.95;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all 0.3s ease;
}
@media (max-width: 768px) {
  .update-banner-text {
    max-width: 100% !important;
  }
  .update-banner-graphic {
    position: absolute !important;
    right: -10px !important;
    bottom: -10px !important;
    width: 90px !important;
    height: 90px !important;
    opacity: 0.15 !important;
    z-index: 1 !important;
    pointer-events: none !important;
  }
}

/* 5. PDF Document Download Responsive Styles */
@media (max-width: 480px) {
  .lesson-pdf-download-box {
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center !important;
    gap: 0.75rem !important;
  }
  .lesson-pdf-download-box > div {
    flex-direction: column !important;
    align-items: center !important;
  }
  .lesson-pdf-download-box button {
    width: 100% !important;
  }
}

/* 6. Next Lesson Widget Responsive Styles */
@media (max-width: 400px) {
  .next-lesson-box {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    text-align: center !important;
  }
}



/* ==========================================================================
   STUDENT EXAM LIBRARY REDESIGN SYSTEM (UX/UI UPGRADES)
   ========================================================================== */

/* Mini Stats Dashboard */
.library-mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.library-stat-card {
  padding: 1.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  position: relative;
}

.library-stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 12px 32px -4px rgba(99, 102, 241, 0.15);
}

.library-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.library-stat-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.library-stat-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.library-stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: 1.1;
}

.library-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Exam Card & Grid System */
.library-layout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

.layout-toggle-wrapper {
  display: flex;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.layout-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.layout-toggle-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

.library-exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.library-exam-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

/* Redesigned Premium Cards */
.premium-exam-card {
  border-radius: 16px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
  box-shadow: var(--glass-shadow, 0 4px 20px rgba(0, 0, 0, 0.15));
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
  display: flex;
  cursor: pointer;
}

/* Grid Specific Style */
.library-exam-grid .premium-exam-card {
  flex-direction: column;
  height: 100%;
  min-height: 360px;
}

/* List Specific Style */
.library-exam-list .premium-exam-card {
  flex-direction: row;
  align-items: center;
  padding: 1.25rem;
  gap: 1.5rem;
}

.premium-exam-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 16px 36px rgba(99, 102, 241, 0.12), 0 2px 10px rgba(99, 102, 241, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.premium-card-banner {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.library-exam-grid .premium-card-banner {
  width: 100%;
  height: 160px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.library-exam-list .premium-card-banner {
  width: 80px;
  height: 110px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.premium-card-spine {
  border-left: 5px solid rgba(0, 0, 0, 0.25);
  border-radius: 4px 10px 10px 4px !important;
}

.premium-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.library-exam-list .premium-card-body {
  padding: 0;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.premium-card-main-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.premium-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.premium-card-tag {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.tag-simu {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.tag-practice {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.tag-difficulty {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.premium-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.premium-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.premium-card-specs {
  display: flex;
  gap: 1rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.premium-card-progress-section {
  margin-top: auto;
  padding-top: 0.85rem;
}

.library-exam-list .premium-card-progress-section {
  margin-top: 0;
  padding-top: 0;
  min-width: 160px;
}

.premium-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.library-exam-grid .premium-card-actions {
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.85rem;
}

.library-exam-list .premium-card-actions {
  flex-shrink: 0;
}

/* Visual Micro-dash progress */
.card-micro-progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-micro-progress-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.card-micro-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* Premium Setup Modal Styles */
.exam-setup-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.exam-setup-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.exam-setup-modal-container {
  width: 90%;
  max-width: 620px;
  max-height: 85vh;
  border-radius: 20px;
  background: rgba(23, 23, 37, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(30px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.exam-setup-modal-overlay.active .exam-setup-modal-container {
  transform: translateY(0) scale(1);
}

.exam-setup-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
}

.exam-setup-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.exam-setup-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.exam-setup-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.exam-setup-hero {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.exam-setup-hero-cover {
  width: 75px;
  height: 100px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exam-setup-hero-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Modal Mode Segmented Control */
.modal-mode-selector {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.modal-mode-option {
  flex: 1;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-mode-option.active {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.modal-mode-option-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.modal-mode-option.active .modal-mode-option-title {
  color: #818cf8;
}

.modal-mode-option-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Parts Selector Grid */
.modal-parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}

.modal-part-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
  font-weight: 600;
  user-select: none;
}

.modal-part-checkbox-label.active {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.25);
  color: #818cf8;
}

/* History List inside modal */
.modal-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 0.85rem;
}

.modal-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.01);
}

.exam-setup-modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.01);
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .library-exam-list .premium-exam-card {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 1.25rem !important;
    gap: 1.25rem !important;
  }
  
  .library-exam-list .premium-card-banner {
    width: 75px !important;
    height: 100px !important;
  }
  
  .library-exam-list .premium-card-body {
    flex-direction: column !important;
    gap: 1rem !important;
  }
  
  .library-exam-list .premium-card-progress-section {
    min-width: unset !important;
    width: 100% !important;
  }
  
  .modal-mode-selector {
    flex-direction: column;
  }
}

/* ==========================================================================
   NEW STUDENT EXAM LIBRARY REDESIGN SYSTEM (2026 Redesign)
   ========================================================================== */

/* Top Navigation Tabs */
.student-library-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
  width: 100%;
  margin-bottom: 0.5rem;
}

body.dark-theme .student-library-tabs {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.student-library-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.15rem 0.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
}

.student-library-tab-btn:hover {
  background: rgba(0, 0, 0, 0.01);
}

body.dark-theme .student-library-tab-btn:hover {
  background: rgba(255, 255, 255, 0.02);
}

.student-library-tab-btn.active {
  border-bottom-color: #6366f1;
  background: rgba(99, 102, 241, 0.03);
}

body.dark-theme .student-library-tab-btn.active {
  background: rgba(99, 102, 241, 0.08);
}

.student-tab-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}

body.dark-theme .student-tab-title {
  color: #e2e8f0;
}

.student-library-tab-btn.active .student-tab-title {
  color: #6366f1;
}

body.dark-theme .student-library-tab-btn.active .student-tab-title {
  color: #818cf8;
}

.student-tab-subtitle {
  font-size: 0.76rem;
  font-weight: 500;
  color: #9ca3af;
  margin-top: 0.25rem;
  transition: color 0.2s;
}

body.dark-theme .student-tab-subtitle {
  color: #64748b;
}

.student-library-tab-btn.active .student-tab-subtitle {
  color: #818cf8;
}

/* Filters & Search Panel */
.student-filter-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.5rem 0 1rem 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.dark-theme .student-filter-panel {
  background: transparent;
  border: none;
  box-shadow: none;
}

.student-search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}

.student-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.student-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.student-search-input {
  width: 100%;
  height: 42px;
  padding: 0 1rem 0 2.35rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
  font-size: 0.875rem;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
}

body.dark-theme .student-search-input {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  color: #f8fafc;
}

.student-search-input:focus {
  border-color: #6366f1;
  background: #ffffff;
  outline: none;
}

body.dark-theme .student-search-input:focus {
  border-color: #818cf8;
  background: rgba(0, 0, 0, 0.3);
}

.student-sort-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 180px;
}

.student-sort-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #4b5563;
  white-space: nowrap;
}

body.dark-theme .student-sort-label {
  color: #94a3b8;
}

.student-sort-select {
  height: 42px;
  padding: 0 1.5rem 0 0.75rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  font-size: 0.875rem;
  flex: 1;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
}

body.dark-theme .student-sort-select {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  color: #f8fafc;
}

.student-sort-select:focus {
  border-color: #6366f1;
  outline: none;
}

/* Filter Pills Section */
.student-pills-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: #4b5563;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.dark-theme .student-pills-label {
  color: #94a3b8;
}

.student-pills-container {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.student-filter-pill {
  padding: 0.4rem 1.15rem;
  border-radius: 99px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #6366f1;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.01);
}

body.dark-theme .student-filter-pill {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.01);
  color: #818cf8;
}

.student-filter-pill:hover {
  background: rgba(99, 102, 241, 0.05);
  border-color: #6366f1;
}

.student-filter-pill.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

body.dark-theme .student-filter-pill.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #ffffff;
}

/* Card Styling Grid */
.student-exam-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.08);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

body.dark-theme .student-exam-card {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.student-exam-card:hover {
  transform: translateY(-5px);
  border-color: var(--theme-color);
  box-shadow: 0 12px 28px rgba(149, 157, 165, 0.15);
}

body.dark-theme .student-exam-card:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.student-card-top {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.5rem 1.25rem;
  align-items: flex-start;
}

.student-card-cover {
  width: 90px;
  height: 90px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.5rem 0.6rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.student-card-code {
  font-size: 0.75rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.3px;
  text-align: left;
  width: 100%;
  line-height: 1;
}

.student-card-emoji {
  font-size: 2.25rem;
  line-height: 1;
  display: block;
  align-self: center;
  margin-top: auto;
  margin-bottom: auto;
}

.student-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.student-card-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: #4f46e5;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

body.dark-theme .student-card-meta {
  color: #818cf8;
}

.student-card-meta.meta-simu {
  color: #4b5563;
}

body.dark-theme .student-card-meta.meta-simu {
  color: #94a3b8;
}

.student-card-title {
  font-size: 1.025rem;
  font-weight: 800;
  color: #111827;
  margin: 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark-theme .student-card-title {
  color: #f8fafc;
}

.student-card-desc {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark-theme .student-card-desc {
  color: #94a3b8;
}

/* Card Footer Stats / Actions */
.student-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0 1.25rem 1.25rem 1.25rem;
  border-top: none;
  margin-top: auto;
}

.student-card-metrics {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.student-metric-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4b5563;
  white-space: nowrap;
}

body.dark-theme .student-metric-item {
  color: #94a3b8;
}

/* Circular Donut Progress */
.student-card-progress-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(var(--theme-color) calc(var(--percent) * 1%), rgba(0, 0, 0, 0.05) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

body.dark-theme .student-card-progress-circle {
  background: conic-gradient(var(--theme-color) calc(var(--percent) * 1%), rgba(255, 255, 255, 0.08) 0);
}

.student-card-progress-circle::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #ffffff;
}

body.dark-theme .student-card-progress-circle::before {
  background: #111422;
}

.student-card-progress-inner {
  position: relative;
  z-index: 1;
  color: #374151;
}

body.dark-theme .student-card-progress-inner {
  color: #e2e8f0;
}

/* Action Button */
.student-start-btn {
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--theme-color-border, rgba(99, 102, 241, 0.2));
  background: var(--theme-color-bg, rgba(99, 102, 241, 0.04));
  color: var(--theme-color) !important;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.student-start-btn .arrow {
  transition: transform 0.2s ease;
}

.student-start-btn:hover {
  background: var(--theme-color) !important;
  color: #ffffff !important;
  border-color: var(--theme-color) !important;
}

.student-start-btn:hover .arrow {
  transform: translateX(3px);
}

/* Extra overrides for layout responsive styling */
@media (max-width: 600px) {
  .student-library-tabs {
    grid-template-columns: 1fr;
  }
  .student-library-tab-btn {
    padding: 0.8rem 0.5rem;
    border-bottom: none;
    border-left: 3px solid transparent;
  }
  .student-library-tab-btn.active {
    border-left-color: #6366f1;
  }
  .student-card-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .student-card-info {
    align-items: center;
  }
}

/* Responsive Stats Container */
@media (max-width: 640px) {
  .stats-card-container {
    grid-template-columns: 1fr !important;
  }
}

/* Material Symbols Outlined default styling */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* Redesigned Setup Modal Part Cards */
.modal-parts-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}
@media (max-width: 600px) {
  .modal-parts-card-grid {
    grid-template-columns: 1fr;
  }
}
.modal-part-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  user-select: none;
}
body.dark-theme .modal-part-card {
  background: rgba(15, 23, 42, 0.3);
  border-color: rgba(255, 255, 255, 0.05);
}
.modal-part-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}
.modal-part-card.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(129, 140, 248, 0.05) 100%);
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}
.modal-part-card-content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}
.modal-part-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all 0.2s;
}
.modal-part-card.active .modal-part-icon-box {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}
.modal-part-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.modal-part-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}
.modal-part-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.modal-part-card.active .modal-part-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}
.modal-part-title-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-part-subtitle-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}
.modal-part-questions-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #10b981;
  margin-top: 0.15rem;
}
.modal-part-checkbox-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: 0.5rem;
}
.modal-part-card.active .modal-part-checkbox-indicator {
  border-color: #6366f1;
  background: #6366f1;
  color: white;
}

.glass-card {
  background: var(--glass-bg, rgba(255, 255, 255, 0.45));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15));
  border-radius: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body.dark-theme .glass-card {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.glass-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 15px 35px -5px rgba(99, 102, 241, 0.1), 0 10px 15px -5px rgba(99, 102, 241, 0.05);
}
.primary-gradient {
  background: linear-gradient(135deg, #7c3aed 0%, #630ed4 100%) !important;
}
.glow-hover:hover {
  filter: brightness(1.1);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4) !important;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ── Combined Exams Floating Bar (Responsive Layout) ── */
.combined-exams-floating-bar {
  position: fixed !important;
  bottom: 24px !important;
  left: 50% !important;
  transform: translate(-50%, 100px) !important;
  width: max-content !important;
  min-width: 580px !important;
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  padding: 1rem 1.5rem !important;
  border-radius: 1rem !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  z-index: 250 !important; /* higher than bottom nav bar (200) */
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 3rem !important;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.dark-theme .combined-exams-floating-bar {
  background-color: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.combined-exams-floating-bar.active {
  transform: translate(-50%, 0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

@media (max-width: 1023px) {
  .combined-exams-floating-bar {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; /* place it above mobile bottom nav bar (64px + 12px spacing) */
    left: 1rem !important;
    right: 1rem !important;
    transform: translate(0, 100px) !important;
    width: auto !important;
    min-width: 0 !important;
    gap: 1rem !important;
    padding: 0.75rem 1rem !important;
    flex-wrap: wrap !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3) !important;
  }
  .combined-exams-floating-bar.active {
    transform: translate(0, 0) !important;
  }
}

/* Static Combined Exams Bar (Above Table) */
.combined-exams-bar-static {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 1rem 1.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: block;
  align-items: center;
  justify-content: initial;
  gap: 1.5rem;
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  box-sizing: border-box;
}

body.dark-theme .combined-exams-bar-static {
  background-color: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.combined-exams-bar-static button:disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  pointer-events: none;
}

.exam-group-selection-copy {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  justify-content: space-between;
  flex-wrap: nowrap;
}

.exam-group-selection-copy-main {
  min-width: 0;
  flex: 0 1 auto;
}

.exam-group-selection-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.exam-group-selection-filters::-webkit-scrollbar {
  display: none;
}

.exam-group-selection-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  min-width: 0;
  flex-wrap: wrap;
}

.exam-group-selection-filters > button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.exam-group-selection-action-btn {
  min-height: 40px;
}

/* --- Course Viewer Mobile Optimization Styles --- */
.course-viewer-header {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.09);
  color: var(--text-primary);
}

body.dark-theme .course-viewer-header {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(15, 23, 42, 0.74);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.course-viewer-header-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

body.dark-theme .course-viewer-header-toolbar {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.course-viewer-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.45rem 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-family: "Sukhumvit Set", var(--font-sans);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.course-viewer-back-btn:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.09);
  transform: translateX(-2px);
}

.course-viewer-back-btn:focus-visible,
.course-viewer-tab-btn:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.34);
  outline-offset: 2px;
}

.course-viewer-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 34px;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(217, 119, 6, 0.26);
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.1);
  color: #9a5a00;
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

body.dark-theme .course-viewer-access-badge {
  color: #fcd34d;
}

.course-viewer-access-badge.preview {
  border-color: rgba(14, 165, 233, 0.28);
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1;
}

body.dark-theme .course-viewer-access-badge.preview {
  color: #7dd3fc;
}

.course-viewer-hero-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  padding: 1.25rem;
}

.course-viewer-cover {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  border-radius: 18px;
  background-position: center !important;
  background-size: cover !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.course-viewer-cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0.48));
}

.course-viewer-cover > span {
  position: absolute;
  z-index: 1;
  left: 1rem;
  bottom: 0.9rem;
  padding: 0.28rem 0.58rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.42);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.course-viewer-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0.45rem 0.4rem 0.45rem 0;
}

.course-viewer-eyebrow {
  color: #6658d9;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.05em;
}

body.dark-theme .course-viewer-eyebrow {
  color: #aaa1ff;
}

.course-viewer-info h1 {
  margin: 0.38rem 0 0.55rem;
  color: var(--text-primary);
  font-family: "Sukhumvit Set", var(--font-sans);
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.course-viewer-info > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.course-viewer-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 1.15rem;
}

.course-viewer-meta-grid > div {
  min-width: 0;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.07);
}

.course-viewer-meta-grid span,
.course-viewer-meta-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-viewer-meta-grid span {
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 750;
}

.course-viewer-meta-grid strong {
  margin-top: 0.2rem;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 850;
}

.course-viewer-progress {
  height: 7px;
  overflow: hidden;
  margin-top: 0.75rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.course-viewer-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #14b8a6);
  transition: width 0.35s ease;
}

.course-viewer-progress-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.course-viewer-progress-item {
  min-width: 0;
  padding: 0.72rem 0.78rem;
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.055);
}

.course-viewer-progress-item.is-lessons {
  border-color: rgba(20, 184, 166, 0.18);
  background: rgba(20, 184, 166, 0.06);
}

body.dark-theme .course-viewer-progress-item {
  border-color: rgba(129, 140, 248, 0.22);
  background: rgba(99, 102, 241, 0.1);
}

body.dark-theme .course-viewer-progress-item.is-lessons {
  border-color: rgba(45, 212, 191, 0.22);
  background: rgba(20, 184, 166, 0.09);
}

.course-viewer-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 800;
}

.course-viewer-progress-heading span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-viewer-progress-heading strong {
  flex: 0 0 auto;
  color: #5b55de;
  font-size: 0.84rem;
  font-weight: 900;
}

.course-viewer-progress-item.is-lessons .course-viewer-progress-heading strong {
  color: #0f9f91;
}

body.dark-theme .course-viewer-progress-heading strong {
  color: #a8a3ff;
}

body.dark-theme .course-viewer-progress-item.is-lessons .course-viewer-progress-heading strong {
  color: #5eead4;
}

.course-viewer-progress-summary .course-viewer-progress {
  height: 6px;
  margin-top: 0.52rem;
}

.course-viewer-progress.is-lessons > span {
  background: linear-gradient(90deg, #0f9f91, #2dd4bf);
}

.course-viewer-progress-item small {
  display: block;
  overflow: hidden;
  margin-top: 0.42rem;
  color: var(--text-muted);
  font-size: 0.65rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-viewer-nav-row {
  display: grid;
  grid-template-columns: minmax(360px, 0.75fr) minmax(0, 1.25fr);
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 1.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.045);
}

body.dark-theme .course-viewer-nav-row {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.course-viewer-current-lesson {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  min-width: 0;
  min-height: 54px;
  padding: 0.2rem 0.4rem;
}

.course-viewer-current-lesson span {
  color: #6658d9;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

body.dark-theme .course-viewer-current-lesson span {
  color: #aaa1ff;
}

.course-viewer-current-lesson strong {
  overflow: visible;
  width: 100%;
  color: var(--text-primary);
  font-family: "Sukhumvit Set", var(--font-sans);
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  font-weight: 900;
  line-height: 1.35;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.course-outline-full-width {
  width: 100%;
  padding: clamp(1.15rem, 2.5vw, 2rem) !important;
}

.course-outline-title {
  margin: 0 0 1rem;
  color: var(--text-primary);
  font-family: "Sukhumvit Set", var(--font-sans);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 900;
  line-height: 1.35;
}

.course-outline-list {
  width: 100%;
  min-width: 0;
}

.course-certificate-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.course-certificate-card h3 {
  margin: 0;
  color: var(--text-primary);
}

.course-certificate-card p {
  margin: 0.3rem 0 0;
  color: var(--text-secondary);
}

.course-viewer-tabs {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem !important;
  padding: 0.35rem !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: none;
  transition: all 0.2s ease;
}

body.dark-theme .course-viewer-tabs {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(255, 255, 255, 0.09) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.course-viewer-tab-btn {
  min-width: 0;
  height: 46px;
  border: 0 !important;
  border-radius: 10px;
  background: transparent !important;
  color: var(--text-muted) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  font-size: 0.9rem !important;
  font-weight: 800 !important;
  line-height: 1;
  padding: 0 0.75rem !important;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.course-viewer-tab-btn:hover {
  color: var(--text-primary) !important;
  background: rgba(99, 102, 241, 0.08) !important;
}

.course-viewer-tab-btn.is-active {
  background: linear-gradient(135deg, #6366f1, #14b8a6) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.22);
}

.course-viewer-tab-btn svg {
  flex: 0 0 auto;
}

.course-viewer-tab-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-reading-empty-state {
  align-items: center;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  display: grid;
  gap: 1rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-bottom: 1rem;
  padding: 1.1rem 1.2rem;
}

body.dark-theme .lesson-reading-empty-state {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.lesson-reading-empty-icon {
  align-items: center;
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 12px;
  color: #0f766e;
  display: inline-flex;
  height: 48px;
  justify-content: center;
  width: 48px;
}

body.dark-theme .lesson-reading-empty-icon {
  color: #5eead4;
}

.lesson-reading-empty-title {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.3;
  margin: 0;
}

.lesson-reading-empty-desc {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
  margin-top: 0.2rem;
}

.lesson-reading-complete-badge,
.lesson-reading-complete-btn {
  align-items: center;
  border-radius: 10px !important;
  display: inline-flex !important;
  flex-shrink: 0;
  font-size: 0.84rem !important;
  font-weight: 850 !important;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0 0.95rem !important;
  white-space: nowrap;
}

.lesson-reading-complete-badge {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.24);
  color: #16a34a;
}

body.dark-theme .lesson-reading-complete-badge {
  color: #86efac;
}

/* Course outline: in-place collapse animation and media-aware lesson markers */
.course-outline-group {
  margin-bottom: 1rem;
}

.chapter-header-toggle,
.section-heading-toggle {
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.chapter-header-toggle:hover,
.section-heading-toggle:hover {
  background-color: rgba(99, 102, 241, 0.08) !important;
  border-color: rgba(99, 102, 241, 0.2) !important;
}

.chapter-header-toggle:focus-visible,
.section-heading-toggle:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.3);
  outline-offset: 2px;
}

.course-outline-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  transition: color 0.18s ease, transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chapter-header-toggle:not(.is-collapsed) .course-outline-chevron,
.section-heading-toggle:not(.is-collapsed) .course-outline-chevron {
  color: #6366f1 !important;
}

.course-outline-group-body {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
}

.course-outline-group-body.is-collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}

.course-outline-group-body-inner {
  min-height: 0;
  overflow: hidden;
  padding-left: 0.5rem;
}

.lesson-outline-row {
  max-height: 360px;
  opacity: 1;
  transform: translateY(0);
  transform-origin: top;
  transition: max-height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.18s ease,
    transform 0.24s ease,
    padding 0.24s ease,
    margin 0.24s ease,
    border-width 0.24s ease,
    background-color 0.18s ease;
}

.lesson-outline-row.is-section-hidden {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px);
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
  border-top-width: 0 !important;
  border-bottom-width: 0 !important;
}

.course-outline-toolbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  padding: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.06);
}

.course-outline-search-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 260px;
  min-height: 42px;
  padding: 0 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-muted);
}

body.dark-theme .course-outline-search-field {
  background: rgba(15, 23, 42, 0.62);
  border-color: rgba(255, 255, 255, 0.12);
}

.course-outline-search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.84rem;
}

.course-outline-search-field:focus-within {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.course-outline-current-btn {
  min-height: 42px;
  padding: 0 0.85rem !important;
  white-space: nowrap;
  font-size: 0.78rem !important;
}

.course-outline-filter-status {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.course-outline-group.is-filter-hidden {
  display: none;
}

.lesson-outline-row.is-search-hidden {
  display: none !important;
}

.lesson-outline-row:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.28);
  outline-offset: 2px;
}

body.dark-theme .course-outline-toolbar {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 640px) {
  .course-outline-toolbar {
    align-items: stretch;
  }

  .course-outline-search-field,
  .course-outline-current-btn,
  .course-outline-filter-status {
    flex-basis: 100%;
  }

  .course-outline-filter-status {
    padding: 0 0.15rem;
  }
}

.lesson-media-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  margin-top: 0.05rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 0.95rem;
  line-height: 1;
}

.lesson-media-label,
.lesson-locked-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.1rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
}

.lesson-media-icon-video,
.lesson-media-label-video {
  border-color: rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.lesson-media-icon-html,
.lesson-media-label-html {
  border-color: rgba(147, 51, 234, 0.2);
  background: rgba(147, 51, 234, 0.1);
  color: #7e22ce;
}

.lesson-media-icon-quiz,
.lesson-media-label-quiz {
  border-color: rgba(217, 119, 6, 0.22);
  background: rgba(217, 119, 6, 0.1);
  color: #a16207;
}

.lesson-media-icon-article,
.lesson-media-label-article {
  border-color: rgba(13, 148, 136, 0.2);
  background: rgba(13, 148, 136, 0.1);
  color: #0f766e;
}

.lesson-locked-label {
  border-color: rgba(100, 116, 139, 0.2);
  background: rgba(100, 116, 139, 0.09);
  color: var(--text-muted);
}

body.dark-theme .lesson-media-icon-video,
body.dark-theme .lesson-media-label-video { color: #93c5fd; }
body.dark-theme .lesson-media-icon-html,
body.dark-theme .lesson-media-label-html { color: #d8b4fe; }
body.dark-theme .lesson-media-icon-quiz,
body.dark-theme .lesson-media-label-quiz { color: #fcd34d; }
body.dark-theme .lesson-media-icon-article,
body.dark-theme .lesson-media-label-article { color: #5eead4; }

@media (prefers-reduced-motion: reduce) {
  .course-outline-group-body,
  .lesson-outline-row,
  .course-outline-chevron {
    transition: none !important;
  }
}

@media (max-width: 768px) {
  .course-viewer-header {
    border-radius: 18px;
  }
  .course-viewer-header-toolbar {
    min-height: 54px;
    padding: 0.55rem 0.8rem;
  }
  .course-viewer-back-btn {
    padding-left: 0.35rem;
  }
  .course-viewer-hero-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.8rem;
  }
  .course-viewer-cover {
    min-height: 170px;
    border-radius: 14px;
  }
  .course-viewer-info {
    padding: 0.25rem 0.25rem 0.5rem;
  }
  .course-viewer-info h1 {
    font-size: 1.45rem;
  }
  .course-viewer-meta-grid {
    margin-top: 0.9rem;
  }
  .course-viewer-progress-summary {
    margin-top: 0.6rem;
  }
  .course-viewer-nav-row {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.7rem 0.8rem 0.8rem;
  }
  .course-viewer-current-lesson {
    grid-row: 1;
    min-height: auto;
    padding: 0.15rem 0.2rem 0.35rem;
  }
  .course-viewer-current-lesson strong {
    display: block;
    overflow: visible;
    font-size: clamp(1rem, 4vw, 1.16rem);
    line-height: 1.4;
    white-space: normal;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .course-viewer-tabs {
    border-radius: 12px;
    gap: 0.25rem !important;
    padding: 0.25rem !important;
  }
  .course-viewer-tabs::-webkit-scrollbar {
    display: none !important;
  }
  .course-viewer-tab-btn {
    height: 42px;
    font-size: 0.82rem !important;
    gap: 0.3rem;
    padding: 0 0.45rem !important;
  }
  .course-viewer-tab-btn svg {
    width: 17px;
    height: 17px;
  }
  .dashboard-layout {
    gap: 1.25rem !important;
  }
  .glass-panel {
    padding: 1.25rem !important;
  }
  .course-certificate-card {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .course-certificate-card .btn {
    grid-column: 1 / -1;
    width: 100%;
  }
  .lesson-reading-empty-state {
    align-items: stretch;
    gap: 0.75rem;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 1rem;
  }
  .lesson-reading-empty-icon {
    height: 42px;
    width: 42px;
  }
  .lesson-reading-empty-title {
    font-size: 0.96rem;
  }
  .lesson-reading-empty-desc {
    font-size: 0.8rem;
  }
  .lesson-reading-complete-badge,
  .lesson-reading-complete-btn {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }
}

@media (min-width: 769px) and (max-width: 1050px) {
  .course-viewer-hero-grid {
    grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
    gap: 1.25rem;
  }
  .course-viewer-cover {
    min-height: 210px;
  }
  .course-viewer-nav-row {
    grid-template-columns: minmax(330px, 0.9fr) minmax(0, 1.1fr);
  }
}

@media (max-width: 480px) {
  .course-viewer-access-badge {
    max-width: 44vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .course-viewer-cover {
    min-height: 145px;
  }
  .course-viewer-meta-grid {
    grid-template-columns: 1fr 1fr;
  }
  .course-viewer-progress-summary {
    grid-template-columns: 1fr;
  }
  .course-viewer-progress-heading,
  .course-viewer-progress-item small {
    font-size: 0.7rem;
  }
}

/* Floating Web Picture-in-Picture */
.floating-video-pip {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  width: 360px !important;
  height: 202px !important; /* 16:9 ratio */
  z-index: 99999 !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  background: #000 !important;
  animation: floatIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  transition: all 0.3s ease !important;
}

@keyframes floatIn {
  from {
    transform: translateY(100px) scale(0.8);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.floating-video-pip-close {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(4px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 100000 !important;
  font-size: 14px !important;
  font-weight: bold !important;
  transition: background 0.2s, transform 0.2s !important;
}

.floating-video-pip-close:hover {
  background: rgba(239, 68, 68, 0.9) !important;
  transform: scale(1.1) !important;
}

@media (max-width: 768px) {
  .floating-video-pip {
    width: 260px !important;
    height: 146px !important;
    bottom: 16px !important;
    right: 16px !important;
  }
}

/* Pseudo Fullscreen for iOS and devices that do not support Element Fullscreen on Divs */
.pseudo-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #000 !important;
}

/* Global Dark Mode Input Overrides to fix any invisible text issues */
body:not(.light-theme) input[type="text"],
body:not(.light-theme) input[type="email"],
body:not(.light-theme) input[type="password"],
body:not(.light-theme) input[type="number"],
body:not(.light-theme) input[type="search"],
body:not(.light-theme) input:not([type]),
body:not(.light-theme) select,
body:not(.light-theme) textarea,
body.dark-theme input[type="text"],
body.dark-theme input[type="email"],
body.dark-theme input[type="password"],
body.dark-theme input[type="number"],
body.dark-theme input[type="search"],
body.dark-theme input:not([type]),
body.dark-theme select,
body.dark-theme textarea {
  background-color: rgba(15, 23, 42, 0.8) !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

body:not(.light-theme) input[type="text"]::placeholder,
body:not(.light-theme) input[type="email"]::placeholder,
body:not(.light-theme) input[type="password"]::placeholder,
body:not(.light-theme) input[type="number"]::placeholder,
body:not(.light-theme) input[type="search"]::placeholder,
body:not(.light-theme) input:not([type])::placeholder,
body:not(.light-theme) textarea::placeholder,
body.dark-theme input[type="text"]::placeholder,
body.dark-theme input[type="email"]::placeholder,
body.dark-theme input[type="password"]::placeholder,
body.dark-theme input[type="number"]::placeholder,
body.dark-theme input[type="search"]::placeholder,
body.dark-theme input:not([type])::placeholder,
body.dark-theme textarea::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}

/* Ensure focus states are also clear */
body:not(.light-theme) input:focus,
body:not(.light-theme) select:focus,
body:not(.light-theme) textarea:focus,
body.dark-theme input:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
  background-color: rgba(15, 23, 42, 0.95) !important;
  color: #ffffff !important;
  border-color: rgb(20, 184, 166) !important;
  outline: none !important;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.3) !important;
}

/* Custom spacing & layout optimizations for mobile/tablet screens */
@media (max-width: 900px) {
  /* Workspace spacing optimizations */
  .workspace-left, .workspace-right {
    padding: 1.25rem 1rem !important; /* Healthy padding so letters don't stick to the card edge */
    gap: 1.25rem !important;
    min-height: 0;
  }
  
  /* Container layout adjustments */
  .test-workspace {
    gap: 0.75rem !important;
  }
  
  main {
    padding: 0.75rem 0.6rem !important; /* Healthy margin around the workspace cards on mobile */
  }

  /* Header adjustments */
  .test-header {
    padding: 0.75rem 1rem !important;
    gap: 0.75rem !important;
    border-radius: 14px !important;
    margin: 0.5rem !important;
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
  body.light-theme .test-header {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
  }

  /* Modern Glassmorphic Workspace Tab Switcher */
  .mobile-workspace-tabs {
    display: flex !important;
    gap: 0.35rem !important;
    padding: 0.35rem !important;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    margin: 0.25rem 0.5rem 0.75rem 0.5rem !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
  }
  body.light-theme .mobile-workspace-tabs {
    background: rgba(243, 244, 246, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
  }
  .mobile-tab-btn {
    flex: 1 !important;
    border-radius: 10px !important;
    font-size: 0.85rem !important;
    padding: 0.65rem 0.5rem !important;
    font-weight: 700 !important;
    border: 1px solid transparent !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }
  .mobile-tab-btn.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3) !important;
    transform: translateY(-0.5px);
  }
  
  /* Reading passage line-height and typography boost */
  .workspace-left {
    font-size: 0.96rem !important;
    line-height: 1.7 !important;
    letter-spacing: -0.01em !important;
  }
  .workspace-left p {
    margin-bottom: 0.6rem !important;
  }
  
  /* Premium interactive sentence blank triggers */
  .passage-blank-badge.blank-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2)) !important;
    border: 1px solid rgba(99, 102, 241, 0.5) !important;
    color: #a5b4fc !important;
    cursor: pointer !important;
    margin: 0 0.2rem !important;
    vertical-align: middle !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
  }
  body.light-theme .passage-blank-badge.blank-trigger {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.08)) !important;
    border-color: rgba(79, 70, 229, 0.4) !important;
    color: #4f46e5 !important;
  }
  .passage-blank-badge.blank-trigger.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    border-color: #818cf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.4) !important;
    transform: scale(1.08);
  }

  /* Optimized Premium Question Block Card UI */
  .question-block {
    padding: 1.15rem 1rem !important;
    margin-bottom: 0.85rem !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    transition: box-shadow 0.3s ease !important;
  }
  body.light-theme .question-block {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
  }
  
  .question-header {
    margin-bottom: 0.85rem !important;
    gap: 0.5rem !important;
  }
  .question-text {
    font-size: 1.05rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1.25rem !important; /* Space between question stem and options */
    color: var(--text-primary) !important;
  }

  /* Options list items */
  .options-list {
    gap: 0.85rem !important; /* Space between choices */
  }
  .option-group {
    margin-top: 1.25rem !important; /* Space between question stem and options list */
  }
  .option-label {
    padding: 0.95rem 1.25rem !important; /* Comfortably padded options touch target */
    font-size: 0.95rem !important;
    border-radius: 12px !important;
    gap: 0.85rem !important;
    min-height: 48px !important; /* Proper touch targets for mobile accessibility */
    display: flex !important;
    align-items: center !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }
  .option-letter {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.78rem !important;
    border-radius: 6px !important;
  }

  /* Sticky Navigation Bubble Sheet with safe-area inset */
  .navigation-bubble-sheet {
    position: sticky !important;
    bottom: calc(0.5rem + env(safe-area-inset-bottom)) !important;
    z-index: 100 !important;
    border-radius: 16px !important;
    padding: 0.65rem 0.85rem !important;
    margin: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom)) 0.5rem !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
  }
  
  #palette-mini {
    padding: 0.4rem 0.6rem !important;
    gap: 0.5rem !important;
    min-height: 44px !important;
  }
  
  .bubbles-grid {
    gap: 0.35rem !important;
  }
  
  .bubble-btn {
    min-width: 34px !important;
    width: 34px !important;
    min-height: 34px !important;
    height: 34px !important;
    font-size: 0.8rem !important;
    border-radius: 50% !important; /* Restore perfect round circles */
  }
  
  /* Next/Prev Action Buttons in Navigation Sheet */
  .palette-nav-btn {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
  }
}

@media (max-width: 480px) {
  /* Extra spacing protection for tiny screens */
  .workspace-left, .workspace-right {
    padding: 1.25rem 1rem !important;
  }
  
  .option-label {
    padding: 0.85rem 1.15rem !important;
    font-size: 0.92rem !important;
    gap: 0.75rem !important;
  }
  
  .mobile-workspace-tabs {
    margin: 0.25rem 0.35rem 0.65rem 0.35rem !important;
  }
  
  .test-header {
    margin: 0.35rem !important;
    padding: 0.65rem 0.85rem !important;
  }

  .navigation-bubble-sheet {
    margin: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom)) 0.35rem !important;
    padding: 0.5rem 0.65rem !important;
  }
}

/* Part 2 Premium Option Card overrides */
.part2-option-card {
  border-radius: 16px !important;
  padding: 1.2rem 1.5rem !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02) !important;
}

body.light-theme .part2-option-card {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
}

body.light-theme .part2-option-card:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04) !important;
}

.part2-option-card .option-letter {
  width: 34px !important;
  height: 34px !important;
  font-size: 0.95rem !important;
  border-radius: 50% !important;
  font-weight: 700 !important;
}

body.light-theme .part2-option-card .option-letter {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.light-theme .option-input:checked + .part2-option-card {
  background: #f5f3ff !important;
  border-color: #8b5cf6 !important;
  color: #6d28d9 !important;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.12) !important;
}

body.light-theme .option-input:checked + .part2-option-card .option-letter {
  background: #8b5cf6 !important;
  border-color: #8b5cf6 !important;
  color: #ffffff !important;
}

/* Part 2 Footer Button Styles */
.part2-btn-prev {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  height: 40px !important;
  width: 120px !important;
  font-size: 0.85rem !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
}
body.dark-theme .part2-btn-prev {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
}
.part2-btn-prev:hover:not(:disabled) {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}
body.dark-theme .part2-btn-prev:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1) !important;
}
.part2-btn-prev:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
}

.part2-btn-submit {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  height: 40px !important;
  width: 180px !important;
  font-size: 0.85rem !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.part2-btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #34d399, #10b981) !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35) !important;
  transform: translateY(-1px);
}
.part2-btn-submit:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
}

.part2-btn-next {
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  height: 40px !important;
  width: 120px !important;
  font-size: 0.85rem !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.part2-btn-next:hover:not(:disabled) {
  background: linear-gradient(135deg, #818cf8, #6366f1) !important;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3) !important;
  transform: translateY(-1px);
}
.part2-btn-next:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
}

.workspace-left p,
.passage-content p,
#p-content p,
.prose p,
.workspace-left .passage-paragraph-pair,
.workspace-left .answer-zone,
.workspace-left .single-passage-container p,
.workspace-left .single-passage-container div.answer-zone,
.workspace-left .visual-template-email div[style*="white-space: pre-wrap"],
.workspace-left .visual-template-memo div[style*="white-space: pre-wrap"] {
  margin-top: 0 !important;
  margin-bottom: 0.38rem !important; /* Compact spacing like real TOEIC paper */
  line-height: 1.65 !important;
}

/* Compact reading mockups: keep bilingual passages readable without oversized gaps. */
.workspace-left .compact-reading-mockup p,
.workspace-left .compact-reading-mockup .answer-zone,
.workspace-left .compact-reading-mockup .answer-zone p {
  margin-top: 0 !important;
  margin-bottom: 0.2rem !important;
  line-height: 1.45 !important;
}
.workspace-left .compact-reading-mockup p:last-child,
.workspace-left .compact-reading-mockup .answer-zone:last-child,
.workspace-left .compact-reading-mockup .answer-zone p:last-child {
  margin-bottom: 0 !important;
}
.workspace-left .compact-reading-mockup .th-interlinear {
  margin: 2px 0 5px 0 !important;
  padding: 3px 6px !important;
  line-height: 1.35 !important;
}

/* Adjust last child paragraph to avoid extra trailing spacing */
.workspace-left p:last-child,
.passage-content p:last-child,
#p-content p:last-child,
.prose p:last-child,
.workspace-left .passage-paragraph-pair:last-child,
.workspace-left .answer-zone:last-child {
  margin-bottom: 0 !important;
}

/* Prevent nested double margin inside passage containers */
.workspace-left .passage-paragraph-pair p,
.workspace-left .passage-paragraph-pair .answer-zone,
.workspace-left .answer-zone p {
  margin-bottom: 0 !important;
}


/* Part 6 inline blank style .......(131)........ */
.passage-blank-badge.blank-trigger.part6-blank-trigger {
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  margin: 0 0.1rem !important;
  padding: 0 !important;
  vertical-align: baseline !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
}

.passage-blank-badge.blank-trigger.part6-blank-trigger::before {
  content: ".......(" !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
}

.passage-blank-badge.blank-trigger.part6-blank-trigger::after {
  content: ")........" !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
}

/* Light Theme overrides for Part 6 blank triggers */
body.light-theme .passage-blank-badge.blank-trigger.part6-blank-trigger {
  color: #1e293b !important;
}

/* Hover state: highlight the number and dots in accent color */
.passage-blank-badge.blank-trigger.part6-blank-trigger:hover {
  color: #2563eb !important; /* modern blue */
}
.passage-blank-badge.blank-trigger.part6-blank-trigger:hover::before,
.passage-blank-badge.blank-trigger.part6-blank-trigger:hover::after {
  color: #2563eb !important;
}
body.dark-theme .passage-blank-badge.blank-trigger.part6-blank-trigger:hover {
  color: #60a5fa !important;
}
body.dark-theme .passage-blank-badge.blank-trigger.part6-blank-trigger:hover::before,
body.dark-theme .passage-blank-badge.blank-trigger.part6-blank-trigger:hover::after {
  color: #60a5fa !important;
}

/* Active/focused state */
.passage-blank-badge.blank-trigger.part6-blank-trigger.active {
  color: #db2777 !important; /* highlight pink/magenta */
  background: rgba(219, 39, 119, 0.08) !important;
  border-radius: 4px !important;
  padding: 0 4px !important;
  transform: none !important;
  box-shadow: 0 0 6px rgba(219, 39, 119, 0.15) !important;
}
.passage-blank-badge.blank-trigger.part6-blank-trigger.active::before,
.passage-blank-badge.blank-trigger.part6-blank-trigger.active::after {
  color: #db2777 !important;
}

/* Image Passage Highlight Overlay */
.image-passage-highlight {
  position: absolute !important;
  pointer-events: none !important;
  box-sizing: border-box !important;
  border-radius: 4px !important;
  z-index: 10 !important;
  background-color: rgba(234, 179, 8, 0.18) !important;
  border: 1.5px solid rgba(234, 179, 8, 0.6) !important;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.4) !important;
  transition: opacity 0.2s ease-in-out;
}

/* ==========================================================================
   INTERACTIVE LESSON FULLSCREEN
   Uses a viewport overlay on mobile where element Fullscreen API support is
   inconsistent, especially on iOS Safari.
   ========================================================================== */
body.html-content-overlay-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.html-content-expanded {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #0f172a !important;
  overflow: hidden !important;
}

.html-content-expanded > div:first-child {
  flex: 0 0 auto;
  min-width: 0;
  padding-top: max(0.75rem, env(safe-area-inset-top)) !important;
  padding-right: max(0.75rem, env(safe-area-inset-right)) !important;
  padding-left: max(0.75rem, env(safe-area-inset-left)) !important;
}

.html-content-expanded iframe {
  flex: 1 1 auto !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.html-content-expanded .html-content-collapse-btn {
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}

@media (max-width: 900px) {
  .html-content-expanded > div:first-child {
    min-height: calc(54px + env(safe-area-inset-top));
    gap: 0.4rem !important;
    padding-bottom: 0.5rem !important;
  }

  .html-content-expanded > div:first-child > span,
  .html-content-expanded > div:first-child > div:first-of-type p {
    display: none !important;
  }

  .html-content-expanded > div:first-child > div:first-of-type h3 {
    font-size: 0.82rem !important;
    line-height: 1.2 !important;
  }

  .html-content-expanded .html-content-collapse-btn {
    padding: 0 0.8rem !important;
    font-size: 0.78rem !important;
    white-space: nowrap;
  }
}

/* ========================================================================== 
   EXAM FOCUS MODE
   The test runner owns the viewport on every screen size. This prevents the
   fixed student sidebar and intrinsically wide question content from pushing
   audio controls underneath navigation on desktop.
   ========================================================================== */
.mobile-runner-nav {
  display: none;
}

body.exam-focus-mode {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  overscroll-behavior: none;
}

body.exam-focus-mode #app {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100vh !important;
  min-height: 100vh !important;
  overflow: hidden !important;
}

body.exam-focus-mode #app-header,
body.exam-focus-mode .topbar-container {
  display: none !important;
}

body.exam-focus-mode #app-main,
body.exam-focus-mode.student-sidebar-layout #app-main {
  display: block !important;
  grid-column: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100vh !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 12px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

body.exam-focus-mode #page-content-wrapper,
body.exam-focus-mode .test-runner-container,
body.exam-focus-mode .test-workspace {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body.exam-focus-mode #page-content-wrapper {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.exam-focus-mode .test-runner-container {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  height: 100% !important;
  min-height: 0 !important;
  gap: 12px !important;
  overflow: hidden !important;
}

body.exam-focus-mode .test-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.exam-focus-mode .test-workspace.listening-compact-layout {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) !important;
}

body.exam-focus-mode .test-workspace.part-5-layout {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.exam-focus-mode .test-workspace:not(.resizable-active) .workspace-left,
body.exam-focus-mode .test-workspace:not(.resizable-active) .workspace-right {
  width: auto !important;
}

body.exam-focus-mode .workspace-left,
body.exam-focus-mode .workspace-right,
body.exam-focus-mode .questions-scroll-area,
body.exam-focus-mode .audio-player-card,
body.exam-focus-mode .question-block,
body.exam-focus-mode .option-label {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body.exam-focus-mode .option-label,
body.exam-focus-mode .option-card-inner,
body.exam-focus-mode .question-text {
  overflow-wrap: anywhere;
}

body.exam-focus-mode .navigation-bubble-sheet,
body.exam-focus-mode .desktop-palette-content,
body.exam-focus-mode .bubbles-grid {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body.exam-focus-mode .bubbles-grid {
  overflow-x: auto !important;
  overscroll-behavior-inline: contain;
}

/* Mobile keeps its denser, touch-first composition. */

@media (max-width: 900px) {
  body.exam-focus-mode {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.exam-focus-mode #app {
    display: block !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  body.exam-focus-mode #app-header,
  body.exam-focus-mode .topbar-container {
    display: none !important;
  }

  body.exam-focus-mode #app-main,
  body.exam-focus-mode.student-sidebar-layout #app-main {
    display: block !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body.exam-focus-mode #page-content-wrapper {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.exam-focus-mode .test-runner-container {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    gap: 6px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: max(6px, env(safe-area-inset-top)) 8px max(6px, env(safe-area-inset-bottom)) !important;
  }

  /* Reading Parts 6/7 add a tab row between the header and workspace. Keep
     that row explicit so the workspace and bottom controls do not collapse
     into an untouchable/overflowing area on phones. */
  body.exam-focus-mode .test-runner-container.has-mobile-workspace-tabs {
    grid-template-rows: auto auto minmax(0, 1fr) auto !important;
  }

  /* Compact exam title and progress header */
  body.exam-focus-mode .test-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 64px !important;
    margin: 0 !important;
    padding: 7px 10px !important;
    gap: 4px 8px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  body.exam-focus-mode .test-header .header-title-area {
    min-width: 0 !important;
    gap: 0 !important;
  }

  body.exam-focus-mode .test-header .header-title-area > div:first-child {
    display: none !important;
  }

  body.exam-focus-mode .test-header .header-title-area h2 {
    display: block !important;
    width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 0.92rem !important;
    line-height: 1.2 !important;
  }

  body.exam-focus-mode .test-header .progress-container {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    margin: 0 !important;
  }

  body.exam-focus-mode .test-header .progress-meta {
    margin: 0 0 3px !important;
    font-size: 0.68rem !important;
    line-height: 1 !important;
  }

  body.exam-focus-mode .test-header .progress-meta > span:first-child {
    display: none !important;
  }

  body.exam-focus-mode .test-header .progress-meta > span:last-child {
    margin-left: auto !important;
  }

  body.exam-focus-mode .test-header .progress-bar-bg {
    height: 4px !important;
  }

  body.exam-focus-mode .test-header .header-actions-area {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    width: auto !important;
    gap: 0 !important;
    flex-wrap: nowrap !important;
  }

  body.exam-focus-mode .test-header .header-actions-area > :not(#exit-exam-btn) {
    display: none !important;
  }

  body.exam-focus-mode #exit-exam-btn {
    min-width: 52px !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 10px !important;
    margin: 0 !important;
    font-size: 0.78rem !important;
    border-radius: 10px !important;
  }

  /* The workspace is the only area allowed to scroll on long sections. */
  body.exam-focus-mode .test-workspace {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    gap: 6px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  body.exam-focus-mode .test-workspace:not(.mobile-focus-listening) {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
  }

  /* Parts 1-2 use a fixed viewport composition: media above, answers below. */
  body.exam-focus-mode .test-workspace.mobile-focus-listening {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 1fr) minmax(190px, 38%) !important;
    overflow: hidden !important;
  }

  body.exam-focus-mode .test-workspace.mobile-focus-listening.part-2-layout {
    grid-template-rows: auto minmax(0, 1fr) !important;
  }

  body.exam-focus-mode .test-workspace.mobile-focus-listening .workspace-left,
  body.exam-focus-mode .test-workspace.mobile-focus-listening .workspace-right {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.exam-focus-mode .test-workspace.mobile-focus-listening .workspace-left {
    height: 100% !important;
    gap: 5px !important;
    overflow-y: auto !important;
    padding-right: 0 !important;
    scrollbar-width: none;
  }

  body.exam-focus-mode .test-workspace.mobile-focus-listening .workspace-left::-webkit-scrollbar {
    display: none;
  }

  body.exam-focus-mode .test-workspace.mobile-focus-listening .workspace-left > div:first-child {
    display: none !important;
  }

  body.exam-focus-mode .test-workspace.mobile-focus-listening .workspace-left > div:nth-child(2) {
    height: 100% !important;
    min-height: 0 !important;
    gap: 6px !important;
  }

  body.exam-focus-mode .test-workspace.mobile-focus-listening .workspace-right {
    height: 100% !important;
    overflow: hidden !important;
  }

  body.exam-focus-mode .questions-scroll-area {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    gap: 6px !important;
    padding: 0 2px 4px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  /* Compact audio: retain the essential transport controls. */
  body.exam-focus-mode .mobile-focus-listening .audio-player-card {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 6px 8px !important;
    gap: 5px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  body.exam-focus-mode .mobile-focus-listening .compact-audio-player {
    min-height: 56px !important;
    flex-direction: row !important;
  }

  body.exam-focus-mode .mobile-focus-listening .audio-player-card #audio-rewind-btn,
  body.exam-focus-mode .mobile-focus-listening .audio-player-card #audio-forward-btn,
  body.exam-focus-mode .mobile-focus-listening .audio-player-card #audio-play-btn {
    min-width: 42px !important;
    width: 42px !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 !important;
  }

  body.exam-focus-mode .mobile-focus-listening .audio-player-card #audio-volume-slider {
    display: none !important;
  }

  body.exam-focus-mode .mobile-focus-listening .audio-player-card #audio-speed-select {
    min-height: 34px !important;
    height: 34px !important;
    padding: 0 5px !important;
  }

  /* Part 1 photograph fills the remaining media area without cropping. */
  body.exam-focus-mode .part-1-layout .p1-photo-card,
  body.exam-focus-mode .part-1-layout .photo-container {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-height: 100px !important;
    margin: 0 !important;
    padding: 5px !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  body.exam-focus-mode .part-1-layout .p1-photo-card > div:first-child {
    display: none !important;
  }

  body.exam-focus-mode .part-1-layout .p1-photo-card > div:nth-child(2) {
    top: 8px !important;
    font-size: 0.62rem !important;
    padding: 3px 8px !important;
  }

  body.exam-focus-mode .part-1-layout .p1-photo-frame {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border-radius: 9px !important;
  }

  body.exam-focus-mode .part-1-layout .p1-photo-image,
  body.exam-focus-mode .part-1-layout .photo-container img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    border-radius: 8px !important;
  }

  body.exam-focus-mode .p1-study-tools {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    width: 100% !important;
    margin: 0 !important;
    gap: 4px !important;
  }

  body.exam-focus-mode .p1-study-tools .btn {
    min-width: 0 !important;
    min-height: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 6px !important;
    gap: 4px !important;
    font-size: 0.72rem !important;
    border-radius: 9px !important;
  }

  body.exam-focus-mode .p1-study-tools .btn svg {
    width: 14px !important;
    height: 14px !important;
  }

  body.exam-focus-mode .p1-study-tools .btn.is-active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    border-color: rgba(129, 140, 248, 0.85) !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28) !important;
  }

  body.exam-focus-mode .p1-study-tools .btn.is-active svg {
    color: #ffffff !important;
    stroke: currentColor !important;
  }

  /* Vocab is an intentional bottom sheet on mobile. It no longer squeezes the
     photograph or competes with the independently scrollable answer pane. */
  body.exam-focus-mode .mobile-focus-listening .vocab-display-panel {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: calc(70px + env(safe-area-inset-bottom)) !important;
    z-index: 180 !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(42dvh, 360px) !important;
    margin: 0 !important;
    padding: 14px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    border-radius: 18px !important;
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.38) !important;
    box-sizing: border-box !important;
  }

  body.exam-focus-mode:not(.light-theme) .mobile-focus-listening .vocab-display-panel {
    background: #ecfdf5 !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
  }

  /* Dense but finger-safe answer composition. */
  body.exam-focus-mode .mobile-focus-listening .question-block {
    width: 100% !important;
    margin: 0 !important;
    padding: 9px !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
  }

  body.exam-focus-mode .mobile-focus-listening .question-block > div:first-child {
    margin-bottom: 4px !important;
  }

  body.exam-focus-mode .mobile-focus-listening .question-text {
    margin: 0 0 5px !important;
    font-size: 0.93rem !important;
    line-height: 1.35 !important;
  }

  body.exam-focus-mode .mobile-focus-listening .option-group {
    width: 100% !important;
    margin-top: 5px !important;
    gap: 6px !important;
  }

  body.exam-focus-mode .mobile-focus-listening .option-wrapper {
    width: 100% !important;
    margin: 0 !important;
  }

  body.exam-focus-mode .mobile-focus-listening .option-label {
    min-height: 46px !important;
    margin: 0 !important;
    padding: 5px 8px !important;
    border-radius: 10px !important;
  }

  body.exam-focus-mode .mobile-focus-listening .option-letter {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    margin-right: 5px !important;
    font-size: 0.84rem !important;
    border-radius: 7px !important;
  }

  body.exam-focus-mode .mobile-focus-listening .practice-actions {
    margin-top: 6px !important;
    gap: 5px !important;
  }

  body.exam-focus-mode .mobile-focus-listening .practice-actions .btn {
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 10px !important;
    margin: 0 !important;
  }

  body.exam-focus-mode .mobile-focus-listening .p1-letter-grid .option-group {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  body.exam-focus-mode .mobile-focus-listening .p1-letter-grid .option-label {
    height: 50px !important;
    min-height: 50px !important;
    justify-content: center !important;
  }

  body.exam-focus-mode .mobile-focus-listening .p1-letter-grid .option-card-inner > div:first-child,
  body.exam-focus-mode .mobile-focus-listening .p1-letter-grid .option-card-inner > div:first-child > div:first-child {
    justify-content: center !important;
    flex: 0 1 auto !important;
  }

  body.exam-focus-mode .mobile-focus-listening .p1-letter-grid .option-letter {
    margin: 0 !important;
  }

  body.exam-focus-mode .mobile-focus-listening .p1-letter-grid .option-text-span {
    display: none !important;
  }

  /* One fixed bottom action bar replaces duplicate submit/navigation rows. */
  body.exam-focus-mode .runner-nav-actions {
    display: none !important;
  }

  body.exam-focus-mode .navigation-bubble-sheet,
  body.exam-focus-mode #palette-mini {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    min-height: 56px !important;
    margin: 0 !important;
    padding: 5px !important;
    border-radius: 13px !important;
    box-sizing: border-box !important;
    z-index: 100 !important;
  }

  body.exam-focus-mode .desktop-palette-content {
    display: none !important;
  }

  body.exam-focus-mode .mobile-runner-nav {
    display: grid !important;
    grid-template-columns: minmax(88px, 1fr) auto minmax(88px, 1fr) !important;
    align-items: center !important;
    gap: 5px !important;
    width: 100% !important;
  }

  body.exam-focus-mode .mobile-runner-nav.has-submit {
    grid-template-columns: minmax(48px, 0.75fr) minmax(78px, auto) minmax(48px, 0.75fr) minmax(76px, 1fr) !important;
  }

  body.exam-focus-mode .mobile-runner-nav button {
    min-height: 46px !important;
    height: 46px !important;
    margin: 0 !important;
    padding: 0 9px !important;
    border: 0 !important;
    border-radius: 10px !important;
    font: inherit;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  body.exam-focus-mode .test-runner-container button,
  body.exam-focus-mode .test-runner-container input,
  body.exam-focus-mode .test-runner-container select {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  body.exam-focus-mode .question-block .option-label,
  body.exam-focus-mode .audio-player-card button,
  body.exam-focus-mode .audio-player-card select,
  body.exam-focus-mode .audio-player-card input {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* The six-pixel desktop seek line is too small for a finger. Preserve the
     visual track while expanding its hit area on mobile. */
  body.exam-focus-mode #audio-progress-container {
    height: 16px !important;
    min-height: 16px !important;
    padding: 5px 0 !important;
    background-clip: content-box !important;
    touch-action: none !important;
  }

  body.exam-focus-mode .mobile-runner-nav-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
  }

  body.exam-focus-mode .mobile-runner-prev {
    color: var(--text-secondary) !important;
    background: rgba(148, 163, 184, 0.13) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
  }

  body.exam-focus-mode .mobile-runner-next {
    color: #ffffff !important;
    background: linear-gradient(135deg, #6366f1, #2563eb) !important;
    box-shadow: 0 5px 14px rgba(79, 70, 229, 0.25) !important;
  }

  body.exam-focus-mode .mobile-runner-submit {
    color: #ffffff !important;
    background: linear-gradient(135deg, #10b981, #059669) !important;
    box-shadow: 0 5px 14px rgba(16, 185, 129, 0.25) !important;
  }

  body.exam-focus-mode .mobile-runner-grid-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 66px !important;
    color: #a5b4fc !important;
    background: rgba(99, 102, 241, 0.13) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    line-height: 1.05 !important;
  }

  body.exam-focus-mode .mobile-grid-dots {
    font-size: 0.55rem !important;
    letter-spacing: 2px !important;
  }

  body.exam-focus-mode .mobile-runner-nav button:disabled {
    opacity: 0.38 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
  }
}

/* --- PREMIUM MOBILE OPTIMIZATIONS OVERRIDES (Antigravity Custom) --- */
@media (max-width: 768px) {
  /* 1. Floating Sticky Audio Controller */
  .audio-player-card {
    position: sticky !important;
    top: 0 !important;
    z-index: 60 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
  }
  
  body.light-theme .audio-player-card {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
  }

  /* 2. Global Margins & Padding Optimizations for screens */
  .db-outer-wrap, 
  .test-runner-container,
  .exam-library-container,
  .weakness-analysis-container,
  #app-main {
    padding: 0.75rem !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 3. Grid Column Wrap Force */
  .db-row-double,
  .db-row-triple,
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Prevent stat grids from collapsing on mobile */
  .grid.grid-cols-2.keep-cols-mobile {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  .grid.grid-cols-3.keep-cols-mobile {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
  }

  /* 4. Font Sizing Adjustments to prevent line wrapping & overlap */
  h1, .db-greeting-name {
    font-size: 1.4rem !important;
    line-height: 1.2 !important;
  }
  h2, .section-title {
    font-size: 1.2rem !important;
    line-height: 1.25 !important;
  }
  h3 {
    font-size: 1.05rem !important;
  }
  body, p, span, div, td, th {
    font-size: 0.88rem !important;
  }
  
  /* Prevent horizontal scrolling on outer body */
  body, html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
}

@media (max-width: 380px), (max-height: 700px) and (max-width: 900px) {
  body.exam-focus-mode .test-runner-container {
    gap: 4px !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
  }

  body.exam-focus-mode .test-header {
    min-height: 58px !important;
    padding: 5px 8px !important;
  }

  body.exam-focus-mode .test-workspace.mobile-focus-listening {
    grid-template-rows: minmax(0, 1fr) minmax(184px, 39%) !important;
  }

  body.exam-focus-mode .test-workspace.mobile-focus-listening.part-2-layout {
    grid-template-rows: auto minmax(0, 1fr) !important;
  }

  body.exam-focus-mode .p1-study-tools .btn span,
  body.exam-focus-mode .mobile-runner-nav-btn span {
    display: none !important;
  }

  body.exam-focus-mode .mobile-focus-listening .audio-player-card {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }

  body.exam-focus-mode .mobile-focus-listening .audio-player-card #audio-volume-slider {
    display: none !important;
  }

  body.exam-focus-mode .mobile-focus-listening .audio-player-card #audio-rewind-btn,
  body.exam-focus-mode .mobile-focus-listening .audio-player-card #audio-forward-btn,
  body.exam-focus-mode .mobile-focus-listening .audio-player-card #audio-play-btn {
    min-width: 36px !important;
    width: 36px !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    font-size: 0.75rem !important;
  }

  body.exam-focus-mode .mobile-runner-nav {
    grid-template-columns: 1fr auto 1fr !important;
  }

  body.exam-focus-mode .mobile-runner-nav.has-submit {
    grid-template-columns: minmax(44px, 0.7fr) minmax(74px, auto) minmax(44px, 0.7fr) minmax(72px, 1fr) !important;
  }
}

/* --- PREMIUM AUDIO PLAYER CUSTOM STYLES (Antigravity) --- */
.audio-player-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem !important;
  background: rgba(30, 41, 59, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  width: 100%;
  box-sizing: border-box;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme .audio-player-card {
  background: rgba(241, 245, 249, 0.95) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05) !important;
}

/* Seek Bar styling */
#audio-progress-container {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.12) !important;
  width: 100%;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
  transition: height 0.2s;
}

#audio-progress-container:hover {
  height: 8px !important;
}

body.light-theme #audio-progress-container {
  background: rgba(15, 23, 42, 0.08) !important;
}

#audio-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #14b8a6 0%, #0d9488 100%) !important;
  width: 0%;
  border-radius: 4px;
  position: relative;
}

/* Volume Slider */
#audio-volume-slider {
  background: rgba(255, 255, 255, 0.15) !important;
}

body.light-theme #audio-volume-slider {
  background: rgba(15, 23, 42, 0.12) !important;
}

/* Select speed styling */
#audio-speed-select {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: var(--text-primary) !important;
  border-radius: 8px !important;
  padding: 0.3rem 0.6rem !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

body.light-theme #audio-speed-select {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #1e293b !important;
}

.audio-speed-select option,
#audio-speed-select option {
  background: #1e293b !important;
  color: #ffffff !important;
}

body.light-theme .audio-speed-select option,
body.light-theme #audio-speed-select option {
  background: #ffffff !important;
  color: #1e293b !important;
}

/* Toggle Switcher Style */
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #14b8a6 !important;
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

body.light-theme .toggle-slider {
  background-color: rgba(0, 0, 0, 0.08);
}

/* Auto Advance Setting Row */
.auto-advance-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

body.light-theme .auto-advance-setting-row {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.05);
}

.auto-advance-setting-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

/* Audio Countdown Alert */
.audio-countdown-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  animation: fadeIn 0.3s ease-out;
}

.audio-countdown-alert.auto-advance {
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.2);
  color: #14b8a6;
}

.audio-countdown-alert.pre-play {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

body.light-theme .audio-countdown-alert.pre-play {
  color: #4f46e5;
}

.audio-countdown-alert .countdown-seconds {
  font-family: monospace;
  font-weight: 800;
  font-size: 1.15rem;
}

.audio-status-anim {
  display: inline-flex;
  align-items: center;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-ring 1.2s infinite ease-in-out;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.5; }
}

/* ==========================================================================
   TOEIC SIGNAL 990 - Modern Clean Dashboard Design System
   ========================================================================== */
.signal-dashboard-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-family: var(--font-sans);
}

.signal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.signal-greeting-time {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.signal-greeting-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.15rem 0 0 0;
  letter-spacing: -0.02em;
}

.signal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.signal-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.signal-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.signal-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Signal Top Grid: Hero Dual Gauge (Left) & Today's Move (Right) */
.signal-top-grid {
  display: grid;
  grid-template-columns: 2.1fr 1fr;
  gap: 1.5rem;
  width: 100%;
}

@media (max-width: 1024px) {
  .signal-top-grid {
    grid-template-columns: 1fr;
  }
}

/* HERO DUAL GAUGE CARD */
.signal-hero-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 24px;
  padding: 1.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

body.light-theme .signal-hero-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 30px -5px rgba(0,0,0,0.05);
}

.signal-gauge-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  min-width: 140px;
}

.signal-gauge-svg-wrap {
  width: 135px;
  height: 135px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.signal-gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg-ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 8;
}

body.light-theme .gauge-bg-ring {
  stroke: rgba(15, 23, 42, 0.06);
}

.gauge-fill-ring {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.listening-ring {
  stroke: #ec4899 !important; /* Pink Magenta */
  filter: drop-shadow(0 0 8px rgba(236, 72, 153, 0.6));
}

.reading-ring {
  stroke: #0284c7 !important; /* Vibrant Blue */
  filter: drop-shadow(0 0 8px rgba(2, 132, 199, 0.6));
}

.gauge-center-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.gauge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.listening-icon { color: #ec4899; }
.reading-icon { color: #0284c7; }

.gauge-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.gauge-score-value {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
  margin-top: 1px;
}

.listening-score { color: #ec4899; }
.reading-score { color: #0284c7; }

.gauge-score-max {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 1px;
}

.gauge-sparkline-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sparkline-svg {
  width: 60px;
  height: 16px;
}

.gauge-change-tag {
  font-size: 0.72rem;
  font-weight: 800;
}

.listening-tag { color: #ec4899; }
.reading-tag { color: #0284c7; }

/* HERO CENTER READINESS */
.signal-center-readiness {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
  padding: 0 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .signal-center-readiness {
  border-left-color: rgba(15, 23, 42, 0.06);
  border-right-color: rgba(15, 23, 42, 0.06);
}

.readiness-tag-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.readiness-score-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: #10b981;
  line-height: 1;
}

.readiness-dots-bar {
  display: flex;
  gap: 4px;
  margin: 2px 0 6px 0;
}

.readiness-dots-bar .dot {
  width: 10px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}

body.light-theme .readiness-dots-bar .dot {
  background: rgba(15, 23, 42, 0.1);
}

.readiness-dots-bar .dot.active {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.estimated-score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.2rem 0;
}

.est-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.est-score-big {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
}

.est-max {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 1px;
}

.goal-score-pill {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #818cf8;
  padding: 4px 14px;
  border-radius: 999px;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

body.light-theme .goal-score-pill {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.2);
}

.goal-diff {
  color: var(--text-muted);
  font-weight: 600;
}

/* TODAY'S MOVE CARD */
.signal-todays-move-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 24px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--glass-shadow);
  position: relative;
}

body.light-theme .signal-todays-move-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 30px -5px rgba(0,0,0,0.05);
}

.move-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #6366f1;
  text-transform: uppercase;
}

.move-headline {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.4rem 0 0.15rem 0;
  line-height: 1.3;
}

.move-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
  font-weight: 500;
}

.move-target-graphic {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.target-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.move-potential-gain {
  font-size: 1.2rem;
  font-weight: 900;
  color: #6366f1;
}

.move-potential-gain span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-start-session {
  width: 100%;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
  transition: var(--transition-smooth);
}

.btn-start-session:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(79, 70, 229, 0.45);
}

/* WHAT'S NEW BANNER */
.signal-whats-new-banner {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 18px;
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

body.light-theme .signal-whats-new-banner {
  background: rgba(79, 70, 229, 0.04);
  border-color: rgba(79, 70, 229, 0.12);
}

.wn-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.wn-icon-bg {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.wn-tag {
  font-size: 0.65rem;
  font-weight: 800;
  background: #6366f1;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.wn-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wn-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.wn-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.wn-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.wn-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-try-test {
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

body.light-theme .btn-try-test {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

.btn-try-test:hover {
  background: #6366f1;
  color: #ffffff;
  border-color: #6366f1;
}

/* Signal Bottom Grid: Part Signals (Left) & Weekly Trend (Right) */
.signal-bottom-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  width: 100%;
}

@media (max-width: 1024px) {
  .signal-bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* PART SIGNALS CARD */
.signal-part-signals-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 24px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--glass-shadow);
}

body.light-theme .signal-part-signals-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 30px -5px rgba(0,0,0,0.05);
}

.ps-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.ps-header h3 {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin: 0;
  text-transform: uppercase;
}

.ps-confidence {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.ps-confidence strong {
  color: #f59e0b;
}

.ps-columns-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .ps-columns-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.ps-col-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.25rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: var(--transition-fast);
}

body.light-theme .ps-col-item {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.04);
}

.ps-col-item:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

.ps-part-code {
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--text-primary);
}

.ps-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.4rem 0;
}

.ps-score-val {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

.ps-score-range {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.ps-status-pill {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  margin-top: 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ps-status-pill.status-strong {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.ps-status-pill.status-normal {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.ps-status-pill.status-focus {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.ps-status-pill.status-unattempted {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.ps-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.85rem;
}

body.light-theme .ps-footer {
  border-top-color: rgba(15, 23, 42, 0.06);
}

.ps-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.ps-legend .dot-green { color: #10b981; }
.ps-legend .dot-blue { color: #3b82f6; }
.ps-legend .dot-orange { color: #f97316; }

.ps-skill-guide-link {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6366f1;
  text-decoration: none;
}

/* WEEKLY TREND CARD */
.signal-weekly-trend-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 24px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--glass-shadow);
}

body.light-theme .signal-weekly-trend-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 30px -5px rgba(0,0,0,0.05);
}

.wt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wt-header h3 {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin: 0;
  text-transform: uppercase;
}

.wt-diff {
  font-size: 0.88rem;
  font-weight: 900;
  color: #6366f1;
}

.wt-diff small {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.wt-chart-wrap {
  flex: 1;
  min-height: 150px;
  width: 100%;
  margin-top: 0.5rem;
}

.wt-footer {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   TOEIC SIGNAL 990 - High-Grade Dynamic Animations & Interactive Effects
   ========================================================================== */

/* Keyframe Animations */
@keyframes target-pulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(99, 102, 241, 0)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.4)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(99, 102, 241, 0)); }
}

@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes line-draw {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}

@keyframes dot-pop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes button-shimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* Target Graphic Pulsing */
.target-icon-wrap {
  animation: target-pulse 3s infinite ease-in-out;
}

/* Speaker & Badge Floating */
.wn-icon-bg {
  animation: float-gentle 2.5s infinite ease-in-out;
}

.move-badge {
  animation: float-gentle 3s infinite ease-in-out;
}

/* Sequenced Readiness Dots Animation */
.readiness-dots-bar .dot.active {
  animation: dot-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.readiness-dots-bar .dot:nth-child(1) { animation-delay: 0.05s; }
.readiness-dots-bar .dot:nth-child(2) { animation-delay: 0.10s; }
.readiness-dots-bar .dot:nth-child(3) { animation-delay: 0.15s; }
.readiness-dots-bar .dot:nth-child(4) { animation-delay: 0.20s; }
.readiness-dots-bar .dot:nth-child(5) { animation-delay: 0.25s; }
.readiness-dots-bar .dot:nth-child(6) { animation-delay: 0.30s; }
.readiness-dots-bar .dot:nth-child(7) { animation-delay: 0.35s; }
.readiness-dots-bar .dot:nth-child(8) { animation-delay: 0.40s; }
.readiness-dots-bar .dot:nth-child(9) { animation-delay: 0.45s; }
.readiness-dots-bar .dot:nth-child(10) { animation-delay: 0.50s; }

/* Interactive Hover Enhancements */
.signal-hero-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.signal-hero-card:hover {
  box-shadow: 0 16px 45px -10px rgba(99, 102, 241, 0.15);
}

.signal-todays-move-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.signal-todays-move-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -10px rgba(99, 102, 241, 0.2);
}

/* Button Shimmer Beam Effect */
.btn-start-session {
  position: relative;
  overflow: hidden;
}

.btn-start-session::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: skewX(-20deg);
}

.btn-start-session:hover::after {
  animation: button-shimmer 1.2s ease-in-out infinite;
}

/* Part Signals Column Card Pop & Glow */
.ps-col-item {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.ps-col-item:hover {
  transform: translateY(-5px) scale(1.04);
  box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.2);
}

.ps-col-item:hover .ps-score-val {
  color: #6366f1;
  transform: scale(1.1);
  transition: transform 0.2s ease, color 0.2s ease;
}

.ps-col-item:hover .ps-icon-wrap {
  transform: rotate(5deg) scale(1.1);
  transition: transform 0.2s ease;
}

/* SVG Chart Line Drawing */
.wt-chart-wrap svg path[stroke="#6366f1"] {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: line-draw 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* SVG Chart Dots Hover Glow */
.wt-chart-wrap circle {
  transition: r 0.25s ease, fill 0.25s ease, filter 0.25s ease;
  cursor: pointer;
}

.wt-chart-wrap circle:hover {
  r: 7;
  fill: #10b981;
  filter: drop-shadow(0 0 8px #10b981);
}

/* Part Signals Mini Progress Bar Track & Animated Fill */
.ps-mini-bar-track {
  width: 85%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin: 0.35rem 0 0.2rem 0;
}

body.light-theme .ps-mini-bar-track {
  background: rgba(15, 23, 42, 0.08);
}

.ps-mini-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   OPTION 4: GLOWING ESTIMATE SCORE & 3D SKILL BADGES PRE-TEST SUMMARY WIDGET
   ========================================================================== */
.diag-opt4-container {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.75) 0%, rgba(30, 27, 75, 0.6) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 1.75rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

body.light-theme .diag-opt4-container {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(243, 244, 246, 0.9) 100%);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 15px 35px rgba(99, 102, 241, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.diag-opt4-glow-bg {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(16, 185, 129, 0) 70%);
  pointer-events: none;
}

/* Neon Score Display Box */
.diag-neon-score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-theme .diag-neon-score-header {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.diag-score-glow-val {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #10b981 0%, #6366f1 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.4));
  letter-spacing: -0.03em;
}

/* 3D Skill Badges Grid */
.diag-3d-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.85rem;
  margin: 1.5rem 0;
}

.diag-3d-badge-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1rem 0.85rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

body.light-theme .diag-3d-badge-card {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.diag-3d-badge-card:hover {
  transform: translateY(-5px) scale(1.03);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 14px 28px rgba(99, 102, 241, 0.25);
}

.diag-badge-code {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.diag-badge-pct {
  font-size: 1.4rem;
  font-weight: 900;
  margin: 0.2rem 0;
  color: var(--text-primary);
}

.diag-badge-status-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  text-transform: uppercase;
}

.status-strong-pill { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-normal-pill { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }
.status-focus-pill { background: rgba(249, 115, 22, 0.15); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.3); }
.status-unattempted-pill { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Accordion Dropdown Trigger & Content */
.diag-accordion-btn {
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s ease;
}

body.light-theme .diag-accordion-btn {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

.diag-accordion-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.diag-accordion-btn .chevron-icon {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.diag-accordion-btn.expanded .chevron-icon {
  transform: rotate(180deg);
}

.diag-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
}

.diag-accordion-content.expanded {
  max-height: 1200px;
  opacity: 1;
  margin-top: 1rem;
}









/* ==========================================================================
   UNIFIED & REDESIGNED RESPONSIVE DASHBOARD DESIGN SYSTEM (DESKTOP + MOBILE)
   ========================================================================== */

/* State Switcher Bar */
.dash-state-switcher-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
  margin-bottom: 0.5rem;
}
body.light-theme .dash-state-switcher-bar {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.1);
}
.dash-state-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.dash-state-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
.dash-state-pill.active {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.4);
  font-weight: 800;
}

/* Circular Gauge Ring Animation */
.readiness-gauge-circle {
  transition: stroke-dashoffset 1s ease-in-out;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

/* Unified Dashboard Card Levels */
.card-level-1-hero {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%) !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  border-radius: 24px !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 30px rgba(99, 102, 241, 0.1) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1.75rem !important;
  position: relative;
  overflow: hidden;
}
body.light-theme .card-level-1-hero {
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
  border-color: rgba(99, 102, 241, 0.25) !important;
  box-shadow: 0 16px 36px rgba(99, 102, 241, 0.12) !important;
}

.card-level-2-action {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%) !important;
  border: 1px solid rgba(99, 102, 241, 0.35) !important;
  border-radius: 24px !important;
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.18) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1.75rem !important;
}
body.light-theme .card-level-2-action {
  background: linear-gradient(135deg, rgba(243, 244, 256, 0.95) 0%, rgba(238, 242, 255, 0.9) 100%) !important;
}

.card-level-3-analytics {
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 1.5rem !important;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
body.light-theme .card-level-3-analytics {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04) !important;
}
.card-level-3-analytics.interactive-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4) !important;
}

.card-level-4-supporting {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 16px !important;
  padding: 1.25rem !important;
}
body.light-theme .card-level-4-supporting {
  background: rgba(248, 250, 252, 0.8) !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Primary CTA Button */
.btn-primary-cta {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border: none !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-primary-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.55) !important;
  filter: brightness(1.08);
}
.btn-primary-cta:active {
  transform: translateY(0);
}

/* Responsive Layout Adaptation */
@media (max-width: 1024px) {
  .unified-dash-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
}

@media (max-width: 640px) {
  .btn-primary-cta {
    width: 100% !important;
    padding: 0.85rem 1rem !important;
    font-size: 0.95rem !important;
  }
  .card-level-1-hero,
  .card-level-2-action,
  .card-level-3-analytics,
  .card-level-4-supporting {
    padding: 1.15rem !important;
    border-radius: 18px !important;
  }
}


/* ==========================================================================
   SUPER EXAM for TOEIC® SIGNATURE DESIGN SYSTEM: READY ORBIT™, SCORE JOURNEY™, SUPER SIGNAL™
   ========================================================================== */

/* 1. READY ORBIT™ COMPONENT */
.ready-orbit-container {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ready-orbit-svg {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.orbit-ring-base {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 6;
}

.orbit-ring-outer {
  fill: none;
  stroke: url(#ready-orbit-outer-grad);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.orbit-ring-listening {
  fill: none;
  stroke: #818cf8;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.orbit-ring-reading {
  fill: none;
  stroke: #14b8a6;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ready-orbit-center-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.ready-orbit-score-num {
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.ready-orbit-badge-tag {
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-top: 0.25rem;
  text-transform: uppercase;
}

/* 2. SCORE JOURNEY MAP™ COMPONENT */
.score-journey-container {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1rem 1.25rem;
  margin-top: 0.75rem;
}
body.light-theme .score-journey-container {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.08);
}

.roadmap-nodes-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-top: 0.75rem;
}

.roadmap-line-back {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  z-index: 1;
}

.roadmap-line-progress {
  position: absolute;
  left: 5%;
  top: 50%;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #10b981);
  border-radius: 2px;
  z-index: 2;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.roadmap-step-node {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.roadmap-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.roadmap-step-node.completed .roadmap-dot {
  background: #6366f1;
  border-color: #818cf8;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.roadmap-step-node.active-current .roadmap-dot {
  background: #10b981;
  border-color: #ffffff;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.7);
  transform: scale(1.3);
}

.roadmap-node-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}

.roadmap-node-score {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--text-primary);
}

/* 3. SUPER SIGNAL™ AI COACH COMPONENT */
.super-signal-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 18px;
  padding: 1rem 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.super-signal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.super-signal-tag {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: #6366f1;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.super-signal-highlight-box {
  background: rgba(15, 23, 42, 0.4);
  border-left: 3px solid #818cf8;
  padding: 0.65rem 0.85rem;
  border-radius: 0 12px 12px 0;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.super-signal-keyword {
  color: #818cf8;
  font-weight: 800;
  background: rgba(99, 102, 241, 0.15);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}



/* ==========================================================================
   SUPER EXAM for TOEIC® DEDICATED MOBILE UX & RESPONSIVE REFINEMENTS (<768px & <480px)
   ========================================================================== */

@media (max-width: 768px) {
  /* 1. Page Wrapper & Container Padding */
  .db-outer-wrap {
    padding: 0.75rem 0.85rem !important;
    gap: 1rem !important;
  }

  /* 2. Hero Inner Grid: Stack Ready Orbit™ on top of Estimated Score */
  .hero-inner-grid {
    grid-template-columns: 1fr !important;
    justify-items: center;
    gap: 1.25rem !important;
  }

  .ready-orbit-container {
    width: 150px !important;
    height: 150px !important;
  }
  .ready-orbit-svg {
    width: 150px !important;
    height: 150px !important;
  }
  .ready-orbit-score-num {
    font-size: 2rem !important;
  }

  /* 3. Score Journey Map Roadmap on Mobile */
  .score-journey-container {
    padding: 0.85rem 1rem !important;
    margin-top: 0.5rem !important;
  }
  .roadmap-node-label {
    font-size: 0.62rem !important;
  }
  .roadmap-node-score {
    font-size: 0.78rem !important;
  }

  /* 4. Super Signal AI Coach on Mobile */
  .super-signal-card {
    padding: 0.85rem 1rem !important;
  }
  .super-signal-header {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  #hero-sec-cta {
    width: 100% !important;
    text-align: center;
    justify-content: center;
    padding: 0.65rem 1rem !important;
    min-height: 44px;
  }

  /* 5. Today's Mission Card on Mobile */
  .card-level-2-action {
    padding: 1.1rem 1rem !important;
  }

  /* 6. Skill Overview Cards Grid */
  .skill-overview-grid {
    grid-template-columns: 1fr !important;
  }

  /* 7. Focus Area Items on Mobile */
  .focus-area-item-wrap {
    flex-direction: column !alignment;
    align-items: stretch !important;
  }
  .weak-part-rec-link {
    width: 100% !important;
    text-align: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.6rem !important;
    margin-top: 0.35rem;
  }

  /* 8. State Switcher Bar Mobile Swiping */
  .dash-state-switcher-bar {
    padding: 0.4rem 0.6rem !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .dash-state-switcher-bar::-webkit-scrollbar {
    display: none;
  }
  .dash-state-pill {
    padding: 0.4rem 0.85rem !important;
    font-size: 0.75rem !important;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .card-level-1-hero,
  .card-level-2-action,
  .card-level-3-analytics,
  .card-level-4-supporting {
    padding: 1rem !important;
    border-radius: 18px !important;
  }

  .ready-orbit-score-num {
    font-size: 1.85rem !important;
  }
}


/* ==========================================================================
   SUPER EXAM for TOEIC® ADVANCED VISUAL POLISH: AMBIENT GLOW, RIM LIGHTING, TABULAR NUMS
   ========================================================================== */

/* Tabular Numerals for Jitter-Free Performance */
.ready-orbit-score-num,
.score-journey-container,
.card-level-1-hero,
.card-level-3-analytics {
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* 1. Level 1 Hero Ambient Rim Lighting & Border Gradient */
.card-level-1-hero {
  background: linear-gradient(135deg, rgba(24, 20, 60, 0.75) 0%, rgba(12, 16, 32, 0.9) 100%) !important;
  border: 1px solid transparent !important;
  border-image: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(99, 102, 241, 0.4), rgba(255, 255, 255, 0.05)) 1 !important;
  border-radius: 24px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 45px rgba(99, 102, 241, 0.18) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
body.light-theme .card-level-1-hero {
  background: linear-gradient(135deg, rgba(240, 244, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
  box-shadow: 0 18px 40px rgba(99, 102, 241, 0.15) !important;
}

/* 2. Ready Orbit™ Drop Glow Shadows & Neon Filter Effects */
.orbit-ring-outer {
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.6));
}

.orbit-ring-listening {
  filter: drop-shadow(0 0 5px rgba(129, 140, 248, 0.6));
}

.orbit-ring-reading {
  filter: drop-shadow(0 0 5px rgba(20, 184, 166, 0.6));
}

/* 3. Score Journey Map™ Active Node Breathing Pulse Animation */
@keyframes dotBreathingPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    transform: scale(1.25);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    transform: scale(1.35);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    transform: scale(1.25);
  }
}

.roadmap-step-node.active-current .roadmap-dot {
  animation: dotBreathingPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1) !important;
}

/* 4. Super Signal™ Visual Enhancement */
.super-signal-card {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.6) 0%, rgba(15, 23, 42, 0.75) 100%) !important;
  border: 1px solid rgba(99, 102, 241, 0.35) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.super-signal-highlight-box {
  background: rgba(10, 14, 26, 0.5) !important;
  border-left: 3px solid #818cf8 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.super-signal-keyword {
  color: #a5b4fc !important;
  background: rgba(99, 102, 241, 0.22) !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}



/* ==========================================================================
   STUDENT DASHBOARD OVERFLOW FIX, RESPONSIVE ORDERING & CONTRAST POLISH
   ========================================================================== */

/* 1. Prevent Horizontal Overflow at 1280px, 1024px, 768px, 390px, 360px */
.unified-dash-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  gap: 1.5rem;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.col-span-12, .col-span-8, .col-span-7, .col-span-6, .col-span-5, .col-span-4 {
  min-width: 0 !important;
  box-sizing: border-box !important;
  max-width: 100% !important;
}

.db-outer-wrap {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 1360px !important;
  box-sizing: border-box !important;
}

.glass-panel,
.card-level-1-hero,
.card-level-2-action,
.card-level-3-analytics,
.card-level-4-supporting,
.score-journey-container,
.super-signal-card {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* 2. Responsive Mobile Ordering (<= 768px) */
@media (max-width: 768px) {
  .unified-dash-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
  }

  .db-greeting-panel { order: 1 !important; }
  .card-level-2-action { order: 2 !important; } /* Today's Mission FIRST after Greeting */
  .card-level-1-hero { order: 3 !important; }   /* Ready Orbit™ & AI Coach */
  .skill-overview-grid { order: 4 !important; } /* Listening & Reading */
  .card-focus-areas { order: 5 !important; }    /* Focus Areas */
  .card-score-trend { order: 6 !important; }     /* Score Trend */
  .supporting-grid { order: 7 !important; }      /* Baseline & Streak */

  .hero-inner-grid {
    grid-template-columns: 1fr !important;
    justify-items: center;
    gap: 1.25rem !important;
  }
}

/* 3. Text Contrast & Accessible Hierarchy Improvements */
.dash-brand-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
}
body.light-theme .dash-brand-tag {
  background: rgba(79, 70, 229, 0.12);
  color: #4f46e5;
  border-color: rgba(79, 70, 229, 0.25);
}

.estimated-score-disclaimer {
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.4;
  margin-top: 0.3rem;
  font-weight: 500;
}
body.light-theme .estimated-score-disclaimer {
  color: #475569;
}

/* Accessible focus ring */
.btn-primary-cta:focus-visible,
.btn:focus-visible {
  outline: 2px solid #818cf8 !important;
  outline-offset: 2px !important;
}

/* Mobile Bottom Navigation Label Fix */
@media (max-width: 768px) {
  body.student-sidebar-layout #app-header .sidebar-link span.sidebar-label {
    font-size: 0.65rem !important;
    line-height: 1.2 !important;
    text-align: center;
  }
}


/* ==========================================================================
   TOEIC GLASSLAB STUDENT DASHBOARD REDESIGN (SCORE COMPASS HERO & RESUME)
   ========================================================================== */

/* Full Width Hero Grid Item */
.col-span-12 {
  grid-column: span 12 / span 12 !important;
  width: 100% !important;
  min-width: 0 !important;
}

/* Score Compass Hero Container */
.card-score-compass-hero {
  padding: 1.75rem 2rem !important;
  border-radius: 24px !important;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.45) 0%, rgba(15, 23, 42, 0.6) 100%) !important;
  border: 1px solid var(--dash-border-strong) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
}

body.light-theme .card-score-compass-hero {
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%) !important;
  border-color: rgba(99, 102, 241, 0.2) !important;
}

/* Score Compass Inner Grid Layout */
.score-compass-inner-grid {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 2rem;
  align-items: center;
  width: 100%;
}

@media (max-width: 1024px) {
  .score-compass-inner-grid {
    grid-template-columns: 1fr !important;
    justify-items: center;
    text-align: center;
    gap: 1.5rem !important;
  }
}

/* Score Compass Orbit Visualization */
.score-compass-visual-wrap {
  position: relative;
  width: 210px;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 auto;
}

.score-compass-svg {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  width: 210px;
  height: 210px;
}

.compass-ring-base {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 7;
}

.compass-ring-goal {
  fill: none;
  stroke: #f59e0b;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.compass-ring-listening {
  fill: none;
  stroke: #818cf8;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.compass-ring-reading {
  fill: none;
  stroke: #14b8a6;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-compass-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.score-compass-num {
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.score-compass-denom {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.score-compass-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  margin-top: 0.35rem;
  letter-spacing: 0.05em;
}

/* Resume In-Progress Section */
.resume-section-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.resume-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.25s ease;
  min-width: 0;
}

body.light-theme .resume-card {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.08);
}

.resume-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.resume-card-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.resume-badge-test {
  background: rgba(99, 102, 241, 0.18);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.resume-badge-lesson {
  background: rgba(20, 184, 166, 0.18);
  color: #14b8a6;
  border: 1px solid rgba(20, 184, 166, 0.3);
}

/* Responsive Mobile Ordering for Redesigned Dashboard */
@media (max-width: 768px) {
  .unified-dash-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
  }

  .db-greeting-panel { order: 1 !important; }
  .card-score-compass-hero { order: 2 !important; } /* Score Compass Hero FIRST */
  .resume-section-outer { order: 3 !important; }     /* Resume In-Progress SECOND */
  .card-focus-areas { order: 4 !important; }        /* Focus Areas THIRD */
  .card-weekly-metrics { order: 5 !important; }     /* Weekly Metrics FOURTH */
  .supporting-grid { order: 6 !important; }

  .score-compass-visual-wrap {
    width: 170px !important;
    height: 170px !important;
  }
  .score-compass-svg {
    width: 170px !important;
    height: 170px !important;
  }
  .score-compass-num {
    font-size: 1.9rem !important;
  }
}


/* ==========================================================================
   TOEIC GLASSLAB STUDENT DASHBOARD (EXACT MOCKUP MATCHING STYLES)
   ========================================================================== */

/* Outer Dashboard Container */
.db-outer-wrap-mockup {
  padding: 1.5rem 2rem;
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .db-outer-wrap-mockup {
    padding: 1rem;
    gap: 1.2rem;
  }
}

/* Header Area */
.mockup-header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}

.mockup-header-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.mockup-target-pill {
  background: var(--bg-card-secondary, rgba(99, 102, 241, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

body.light-theme .mockup-target-pill {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}

.mockup-target-val {
  color: #6366f1;
  font-weight: 800;
}

.mockup-days-val {
  color: #4f46e5;
  font-weight: 800;
}

/* Hero Card Panel */
.mockup-hero-card {
  background: var(--bg-card, rgba(30, 41, 59, 0.5));
  border: 1px solid var(--dash-border, rgba(255, 255, 255, 0.08));
  border-radius: 24px;
  padding: 1.5rem 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

body.light-theme .mockup-hero-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.mockup-hero-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

/* Hero 2-Column Grid (Desktop) */
.mockup-hero-grid {
  display: grid;
  grid-template-columns: minmax(580px, 1.6fr) minmax(280px, 1fr);
  gap: 2rem;
  align-items: center;
  width: 100%;
}

@media (max-width: 1100px) {
  .mockup-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    justify-items: center;
  }

  .mockup-insight-grid,
  .mockup-status-col {
    max-width: 760px;
  }
}

/* Column 1: Donut Ring Graphic */
.mockup-ring-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.mockup-ring-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mockup-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.mockup-ring-brand {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-muted, #94a3b8);
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.mockup-ring-score {
  font-size: 2.5rem;
  font-weight: 900;
  color: #7c3aed;
  line-height: 1;
  margin: 0.15rem 0;
  font-variant-numeric: tabular-nums;
}

body.dark-theme .mockup-ring-score {
  color: #818cf8;
}

.mockup-ring-denom {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
}

.mockup-ring-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 0.85rem;
}

.mockup-dot-listening {
  color: #ec4899;
  font-size: 1rem;
}

.mockup-dot-reading {
  color: #0284c7;
  font-size: 1rem;
}

/* Column 2: Status Item List */
.mockup-status-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.mockup-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  margin-top: 1.25rem;
}

.mockup-insight-card {
  --insight-color: #6366f1;
  --insight-bg: rgba(99, 102, 241, 0.07);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 78px;
  padding: 0.85rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--insight-color) 20%, transparent);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--insight-bg), rgba(255, 255, 255, 0.72));
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-align: left;
  box-sizing: border-box;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--insight-color) 8%, transparent);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mockup-insight-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 70px;
  height: 70px;
  right: -28px;
  bottom: -34px;
  border-radius: 50%;
  background: var(--insight-color);
  opacity: 0.08;
}

.mockup-insight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--insight-color) 13%, transparent);
}

.mockup-insight-ready {
  --insight-color: #10b981;
  --insight-bg: rgba(16, 185, 129, 0.09);
}

.mockup-insight-evidence {
  --insight-color: #6366f1;
  --insight-bg: rgba(99, 102, 241, 0.08);
}

.mockup-insight-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--insight-color) 14%, white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--insight-color) 12%, transparent);
}

.mockup-insight-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.mockup-insight-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
}

.mockup-insight-value {
  color: var(--insight-color);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.25;
  white-space: normal;
}

.mockup-insight-dot {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--insight-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--insight-color) 12%, transparent);
}

body.dark-theme .mockup-insight-card {
  background: linear-gradient(145deg, var(--insight-bg), rgba(15, 23, 42, 0.55));
  border-color: color-mix(in srgb, var(--insight-color) 26%, transparent);
}

body.dark-theme .mockup-insight-icon {
  background: color-mix(in srgb, var(--insight-color) 18%, #0f172a);
}

.mockup-status-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.mockup-status-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mockup-status-icon {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
}

.mockup-disclaimer-pill {
  background: rgba(99, 102, 241, 0.08);
  border-radius: 12px;
  padding: 0.5rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #6366f1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

body.dark-theme .mockup-disclaimer-pill {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

/* Column 3: Trend Chart & Button */
.mockup-chart-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  gap: 1rem;
  width: 100%;
}

.mockup-chart-wrap {
  width: 100%;
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mockup-btn-outline {
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  border: 1.5px solid #6366f1;
  background: transparent;
  color: #6366f1;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.mockup-btn-outline:hover {
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-1px);
}

/* Section Title Style */
.mockup-sec-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 0.85rem 0;
}

/* Resume Cards Grid */
.mockup-resume-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  width: 100%;
}

@media (max-width: 768px) {
  .mockup-resume-grid {
    grid-template-columns: 1fr;
  }
}

.mockup-resume-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--dash-border, #e2e8f0);
  border-radius: 24px;
  padding: 1.6rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 240px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mockup-resume-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

body.dark-theme .mockup-resume-card {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

.mockup-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1.15rem;
}

.mockup-card-icon-box {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.mockup-icon-purple {
  background: rgba(99, 102, 241, 0.14);
  color: #6366f1;
}

.mockup-icon-green {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
}

.mockup-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mockup-sub-badge-purple {
  font-size: 0.95rem;
  font-weight: 900;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.12);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.mockup-sub-badge-green {
  font-size: 0.95rem;
  font-weight: 900;
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.mockup-card-main-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-primary);
  margin: 0.25rem 0 0.15rem 0;
  line-height: 1.35;
}

.mockup-card-meta {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
}

/* Progress Bar with Percentage Label */
.mockup-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.mockup-progress-header {
  display: flex;
  justify-content: flex-end;
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--text-primary);
}

.mockup-progress-bar-bg {
  width: 100%;
  height: 12px;
  background: rgba(226, 232, 240, 0.7);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

body.dark-theme .mockup-progress-bar-bg {
  background: rgba(255, 255, 255, 0.1);
}

.mockup-progress-fill-purple {
  height: 100%;
  background: linear-gradient(90deg, #818cf8 0%, #6366f1 100%);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mockup-progress-fill-green {
  height: 100%;
  background: linear-gradient(90deg, #34d399 0%, #10b981 100%);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mockup-btn-outline {
  width: 100%;
  padding: 0.85rem 1.35rem;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.mockup-btn-outline:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
  background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%);
}

.mockup-btn-purple-outline {
  width: 100%;
  padding: 0.85rem 1.35rem;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.mockup-btn-purple-outline:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

.mockup-btn-green-outline {
  width: 100%;
  padding: 0.85rem 1.35rem;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.mockup-btn-green-outline:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Focus Areas Panel */
.mockup-focus-panel {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--dash-border, #e2e8f0);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);

  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

body.dark-theme .mockup-focus-panel {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
}

.mockup-focus-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mockup-focus-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
}

body.dark-theme .mockup-focus-row {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.mockup-focus-row:last-child {
  border-bottom: none;
}

.mockup-focus-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mockup-num-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-secondary);
}

body.dark-theme .mockup-num-circle {
  background: rgba(255, 255, 255, 0.1);
}

.mockup-focus-score {
  font-size: 0.9rem;
  font-weight: 800;
}

.mockup-score-red { color: #ef4444; }
.mockup-score-orange { color: #f97316; }

/* Weekly Progress Panel */
.mockup-weekly-panel {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--dash-border, #e2e8f0);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.dark-theme .mockup-weekly-panel {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
}

.mockup-weekly-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 640px) {
  .mockup-weekly-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mockup-weekly-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card-secondary, #f8fafc);
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

body.dark-theme .mockup-weekly-block {
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(255, 255, 255, 0.05);
}

.mockup-weekly-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.mockup-weekly-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.mockup-weekly-val-score {
  font-size: 1.2rem;
  font-weight: 900;
  color: #4338ca;
}

body.dark-theme .mockup-weekly-val-score {
  color: #818cf8;
}

/* Mobile Layout Order */
@media (max-width: 768px) {
  .db-outer-wrap-mockup {
    display: flex !important;
    flex-direction: column !important;
  }
  .mockup-header-wrap { order: 1 !important; }
  .mockup-hero-card { order: 2 !important; }
  .mockup-resume-section { order: 3 !important; }
  .mockup-focus-panel { order: 4 !important; }
  .mockup-weekly-panel { order: 5 !important; }
}

.mockup-dot-total {
  color: #8b5cf6;
  font-size: 1rem;
}

.mockup-dot-listening {
  color: #ec4899;
  font-size: 1rem;
}

.mockup-dot-reading {
  color: #0284c7;
  font-size: 1rem;
}


/* 3 Separate Non-Overlapping Rings Layout (Desktop: Single Horizontal Line) */
.mockup-3rings-wrap {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 1.25rem !important;
  width: 100% !important;
  max-width: 620px !important;
  margin: 0 auto !important;
}

.mockup-ring-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  position: relative;
  flex-shrink: 0 !important;
}

.mockup-ring-card-total {
  transform: scale(1.05);
  flex-shrink: 0 !important;
}

.mockup-ring-sublabel {
  font-size: 0.82rem;
  font-weight: 800;
  margin-top: 0.5rem;
}

.mockup-sublabel-total { color: #8b5cf6; }
.mockup-sublabel-listening { color: #ec4899; }
.mockup-sublabel-reading { color: #0284c7; }


/* Score Trend Panel Placed Directly Below Resume Section */
.mockup-trend-panel {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--dash-border, #e2e8f0);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

body.dark-theme .mockup-trend-panel {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
}


/* Responsive 2-Column Row Grid for Trend & Focus Areas */
@media (max-width: 868px) {
  .mockup-row-grid {
    grid-template-columns: 1fr !important;
  }
}


/* Enhanced Vibrant 3 Score Rings Styles */
.mockup-3rings-wrap {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 1.5rem;
  width: 100%;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

.mockup-ring-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  transition: transform 0.3s ease;
}

.mockup-ring-card:hover {
  transform: translateY(-3px);
}

.mockup-ring-card-total {
  transform: scale(1.08);
}
.mockup-ring-card-total:hover {
  transform: scale(1.12) translateY(-3px);
}

.mockup-ring-circle-anim {
  transition: stroke-dashoffset 1.4s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.mockup-ring-sublabel {
  font-size: 0.88rem;
  font-weight: 800;
  margin-top: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mockup-sublabel-total {
  color: #7c3aed;
  text-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
}
.mockup-sublabel-listening {
  color: #e11d48;
  text-shadow: 0 2px 8px rgba(225, 29, 72, 0.15);
}
.mockup-sublabel-reading {
  color: #0284c7;
  text-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

.mockup-3rings-wrap {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 1.8rem;
  width: 100%;
  flex-wrap: wrap;
  padding: 0.75rem 0;
}

.mockup-ring-sublabel {
  font-size: 0.98rem;
  font-weight: 900;
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}


/* Widget Card Balance & Harmony */
.mockup-hero-card,
.mockup-resume-card,
.mockup-trend-panel,
.mockup-focus-panel,
.mockup-weekly-panel {
  border-radius: 24px !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02) !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

body.dark-theme .mockup-hero-card,
body.dark-theme .mockup-resume-card,
body.dark-theme .mockup-trend-panel,
body.dark-theme .mockup-focus-panel,
body.dark-theme .mockup-weekly-panel {
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3) !important;
}

.mockup-trend-panel,
.mockup-focus-panel {
  padding: 1.5rem 1.75rem !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  height: 100% !important;
  box-sizing: border-box !important;
}

.mockup-row-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1.5rem !important;
  align-items: stretch !important;
  width: 100% !important;
}

@media (max-width: 900px) {
  .mockup-row-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Dashboard hero — balanced full-width score composition */
.mockup-hero-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 1rem !important;
  justify-items: stretch !important;
}

.mockup-ring-col {
  width: 100% !important;
}

.mockup-score-intel-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: clamp(1rem, 2.5vw, 1.75rem);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
}

.mockup-3rings-wrap {
  width: 100%;
  min-width: 0;
  max-width: 760px;
  margin: 0 auto;
  justify-content: center !important;
  gap: clamp(1.5rem, 3vw, 3rem) !important;
  flex-wrap: nowrap !important;
}

.mockup-ring-card:not(.mockup-ring-card-total) svg,
.mockup-ring-card:not(.mockup-ring-card-total) .mockup-ring-box {
  width: 190px !important;
  height: 190px !important;
}

.mockup-ring-card-total svg,
.mockup-ring-card-total .mockup-ring-box {
  width: 230px !important;
  height: 230px !important;
}

.mockup-part-strength-panel {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.08), transparent 40%),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.07);
  padding: 1rem 1.1rem;
  align-self: center;
}

body.dark-theme .mockup-part-strength-panel {
  background:
    radial-gradient(circle at 100% 0%, rgba(139, 92, 246, 0.16), transparent 42%),
    rgba(15, 23, 42, 0.58);
  border-color: rgba(255, 255, 255, 0.1);
}

.mockup-part-strength-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  transition: margin-bottom 0.25s ease;
}

.mockup-part-strength-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.25;
}

.mockup-part-strength-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.1);
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.08);
}

.mockup-part-strength-chip {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  font-size: 0.65rem;
  font-weight: 900;
}

.mockup-part-strength-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.mockup-part-strength-toggle {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(99, 102, 241, 0.14);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.08);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.mockup-part-strength-toggle:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.28);
}

.mockup-part-strength-toggle:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.55);
  outline-offset: 2px;
}

.mockup-part-strength-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s ease;
}

.mockup-part-strength-body {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.3s ease, opacity 0.2s ease;
}

.mockup-part-strength-body-inner {
  min-height: 0;
  overflow: hidden;
}

.mockup-part-strength-panel.is-collapsed .mockup-part-strength-head {
  margin-bottom: 0;
}

.mockup-part-strength-panel.is-collapsed .mockup-part-strength-body {
  grid-template-rows: 0fr;
  opacity: 0;
}

.mockup-part-strength-panel.is-collapsed .mockup-part-strength-toggle svg {
  transform: rotate(180deg);
}

.mockup-part-strength-list {
  display: flex;
  flex-direction: column;
  gap: 0.58rem;
}

.mockup-part-strength-row {
  display: grid;
  grid-template-columns: 72px minmax(92px, 1fr) 42px;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.mockup-part-strength-label {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.mockup-part-strength-label small {
  display: none;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 800;
}

.mockup-part-strength-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.72);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

body.dark-theme .mockup-part-strength-track {
  background: rgba(255, 255, 255, 0.08);
}

.mockup-part-strength-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  transform-origin: left center;
  transition:
    width 1.05s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.25s ease;
  transition-delay: var(--part-strength-delay, 0ms);
}

.mockup-part-strength-panel.is-loaded .mockup-part-strength-fill {
  width: var(--part-strength-target, 0%);
}

@media (prefers-reduced-motion: reduce) {
  .mockup-ring-circle-anim,
  .mockup-part-strength-fill,
  .mockup-part-strength-head,
  .mockup-part-strength-body,
  .mockup-part-strength-toggle svg {
    transition: none !important;
  }
}

.mockup-part-strength-strong {
  background: linear-gradient(90deg, #2dd4bf 0%, #10b981 54%, #059669 100%);
  box-shadow: 0 0 14px rgba(20, 184, 166, 0.24);
}

.mockup-part-strength-medium {
  background: linear-gradient(90deg, #fde047 0%, #f59e0b 56%, #f97316 100%);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.22);
}

.mockup-part-strength-weak {
  background: linear-gradient(90deg, #fb7185 0%, #f43f5e 56%, #dc2626 100%);
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.22);
}

.mockup-part-strength-value {
  color: var(--text-primary);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mockup-part-strength-foot {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.85rem;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.35;
}

.mockup-insight-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(260px, 1.1fr) !important;
  max-width: 1180px !important;
  margin: 1.5rem auto 0 !important;
  align-items: stretch;
}

.mockup-insight-analysis-btn {
  min-height: 78px;
  margin: 0 !important;
  padding: 0.85rem 1.2rem;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  font-size: 0.92rem;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.24);
}

.mockup-insight-analysis-btn:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%);
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.32);
}

.mockup-insight-analysis-btn span:last-child {
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.mockup-insight-analysis-btn:hover span:last-child {
  transform: translateX(3px);
}

@media (max-width: 1280px) and (min-width: 769px) {
  .mockup-score-intel-grid {
    grid-template-columns: 1fr !important;
  }

  .mockup-part-strength-panel {
    width: min(100%, 640px);
    justify-self: center;
  }

  .mockup-3rings-wrap {
    gap: clamp(1rem, 3vw, 2.5rem) !important;
  }

  .mockup-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .mockup-insight-analysis-btn {
    grid-column: 1 / -1;
  }
}

/* Desktop score compass — give the Reading ring a clear breathing space
   before the Part breakdown panel without changing tablet/mobile stacking. */
@media (min-width: 1281px) {
  .mockup-score-intel-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 350px);
    gap: clamp(2rem, 3.5vw, 4rem);
  }

  .mockup-3rings-wrap {
    max-width: 720px;
    gap: clamp(1.75rem, 2.4vw, 3rem) !important;
  }
}


/* ==========================================================================
   MOBILE STUDENT DASHBOARD — SINGLE AUTHORITATIVE BLOCK
   Consolidates ALL mobile overrides for the mockup dashboard.
   Controls: section ordering, ring sizing, sublabel alignment,
   hero card unification, typography, and layout.
   ========================================================================== */
@media (max-width: 768px) {

  /* ── 0. CONTAINER & SECTION ORDERING (matches Desktop sequence) ───────── */
  .db-outer-wrap-mockup {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
    padding: 1rem !important;
  }

  /* Order: Header → Forecast → Diagnostic result → Resume → Trend+Focus → Weekly */
  .mockup-header-wrap    { order: 1 !important; }
  .mockup-hero-card      { order: 2 !important; }
  .dash-diag-baseline    { order: 3 !important; }
  .mockup-resume-section { order: 4 !important; }
  .mockup-row-grid       { order: 5 !important; }
  .mockup-weekly-panel   { order: 6 !important; }

  /* ── 1. HEADER ──────────────────────────────────────────────────────────── */
  .mockup-header-wrap {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    width: 100% !important;
    margin-bottom: 0.25rem !important;
  }

  .mockup-header-title {
    font-size: 1.6rem !important;
    font-weight: 900 !important;
  }

  .mockup-target-pill {
    font-size: 0.92rem !important;
    padding: 0.65rem 1.1rem !important;
    width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* ── 2. HERO CARD (unified — rings + status in ONE white card) ────────── */
  .mockup-hero-card {
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
    padding: 1.5rem 1.25rem !important;
    border-radius: 20px !important;
  }

  .mockup-hero-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
    width: 100% !important;
  }

  .mockup-ring-col {
    order: 1 !important;
    width: 100% !important;
  }

  .mockup-score-intel-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
    max-width: none !important;
  }

  .mockup-status-col {
    order: 2 !important;
    width: 100% !important;
  }

  .mockup-insight-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
    margin-top: 1rem !important;
  }

  .mockup-insight-card {
    min-height: 68px !important;
    padding: 0.75rem 0.85rem !important;
    border-radius: 16px !important;
  }

  .mockup-insight-label {
    font-size: 0.72rem !important;
  }

  .mockup-insight-value {
    font-size: 0.92rem !important;
  }

  .mockup-insight-analysis-btn {
    min-height: 62px !important;
    font-size: 0.9rem !important;
  }

  /* ── 3. THREE RINGS — total first, section scores below ─────────────── */
  .mockup-3rings-wrap {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: start !important;
    justify-items: center !important;
    gap: 1rem 1.25rem !important;
    width: 100% !important;
    max-width: 290px !important;
    margin: 0 auto !important;
    padding: 0.25rem 0 0.5rem !important;
    overflow: visible !important;
  }

  /* All ring cards: keep each score in its own grid cell */
  .mockup-ring-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-width: 0 !important;
    transform: none !important;
    margin: 0 !important;
  }

  .mockup-ring-card-total {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    order: -1 !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 2 !important;
  }

  /* Side rings (Listening & Reading) */
  .mockup-ring-card:not(.mockup-ring-card-total) svg {
    width: 112px !important;
    height: 112px !important;
  }

  .mockup-ring-card:not(.mockup-ring-card-total) .mockup-ring-box {
    width: 112px !important;
    height: 112px !important;
  }

  .mockup-ring-card .mockup-score-anim-val {
    font-size: 1.35rem !important;
    font-weight: 900 !important;
  }

  /* Total score remains the visual focus without colliding with side rings */
  .mockup-ring-card-total svg {
    width: 154px !important;
    height: 154px !important;
  }

  .mockup-ring-card-total .mockup-ring-box {
    width: 154px !important;
    height: 154px !important;
  }

  .mockup-ring-card-total .mockup-score-anim-val {
    font-size: 2rem !important;
    font-weight: 900 !important;
  }

  /* Ring sublabels — ALL on same line, no wrapping */
  .mockup-ring-sublabel {
    font-size: 0.78rem !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
    margin-top: 0.4rem !important;
    text-align: center !important;
  }

  .mockup-sublabel-total {
    font-size: 0.85rem !important;
  }

  .mockup-part-strength-panel {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 1rem 0.9rem !important;
    border-radius: 18px !important;
  }

  .mockup-part-strength-head {
    margin-bottom: 0.8rem !important;
  }

  .mockup-part-strength-title {
    font-size: 0.96rem !important;
  }

  .mockup-part-strength-row {
    grid-template-columns: 64px minmax(0, 1fr) 40px !important;
    gap: 0.55rem !important;
  }

  .mockup-part-strength-track {
    height: 9px !important;
  }

  .mockup-part-strength-value {
    font-size: 0.8rem !important;
  }

  .mockup-part-strength-foot {
    font-size: 0.68rem !important;
  }

  /* ── 4. STATUS LIST & DISCLAIMER (inside hero card) ─────────────────── */
  .mockup-status-list {
    font-size: 0.98rem !important;
    font-weight: 700 !important;
    gap: 0.65rem !important;
  }

  .mockup-status-icon {
    font-size: 1.15rem !important;
    width: 24px !important;
  }

  .mockup-disclaimer-pill {
    font-size: 0.85rem !important;
    padding: 0.65rem 1rem !important;
    line-height: 1.4 !important;
  }

  /* Section titles */
  .mockup-sec-title,
  .mockup-hero-title {
    font-size: 1.3rem !important;
    font-weight: 900 !important;
    margin-bottom: 1rem !important;
  }

  /* ── 5. RESUME SECTION ─────────────────────────────────────────────────── */
  .mockup-resume-section {
    width: 100% !important;
  }

  .mockup-resume-card {
    padding: 1.25rem 1rem !important;
    border-radius: 20px !important;
  }

  .mockup-card-main-title {
    font-size: 1.15rem !important;
    font-weight: 900 !important;
  }

  .mockup-card-meta {
    font-size: 0.88rem !important;
    font-weight: 700 !important;
  }

  .mockup-sub-badge-purple,
  .mockup-sub-badge-green {
    font-size: 0.82rem !important;
  }

  /* ── 6. TREND + FOCUS ROW (stacked on mobile) ──────────────────────────── */
  .mockup-row-grid {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
  }

  .mockup-trend-panel,
  .mockup-focus-panel {
    padding: 1.25rem 1rem !important;
    border-radius: 20px !important;
  }

  .mockup-focus-left {
    font-size: 0.98rem !important;
    font-weight: 800 !important;
  }

  .mockup-focus-score {
    font-size: 0.95rem !important;
    font-weight: 900 !important;
  }

  /* ── 7. WEEKLY METRICS ─────────────────────────────────────────────────── */
  .mockup-weekly-panel {
    width: 100% !important;
    padding: 1.25rem 1rem !important;
    border-radius: 20px !important;
  }

  .mockup-weekly-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .mockup-weekly-val-score,
  .mockup-weekly-val {
    font-size: 1.05rem !important;
    font-weight: 900 !important;
  }

  /* ── 8. BUTTONS ────────────────────────────────────────────────────────── */
  .mockup-btn-outline,
  .mockup-btn-purple-outline,
  .mockup-btn-green-outline {
    font-size: 0.95rem !important;
    padding: 0.8rem 1.2rem !important;
    border-radius: 14px !important;
    font-weight: 900 !important;
  }

  /* ── 9. APP-MAIN LAYOUT (no double margin) ──────────────────────────── */
  #app-main,
  body.student-sidebar-layout #app-main {
    grid-column: 1 !important;
    margin-left: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: calc(52px + env(safe-area-inset-top, 0px) + 0.75rem) 0.875rem calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
/* Exam Inventory / Question Management — Phase 3.5B */
.exam-inventory-filterbar {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
}

.exam-inventory-filter-summary,
.exam-question-management-header,
.question-metadata-editor-heading,
.exam-admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.exam-inventory-filter-summary span,
.question-metadata-editor-heading span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.exam-inventory-filter-grid,
.exam-question-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(120px, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 0.85rem;
}

.exam-inventory-filter-grid label,
.exam-question-filter-grid label,
.question-metadata-editor-grid label,
.exam-admin-form-grid label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 750;
}

.exam-type-badge,
.exam-readiness-badge,
.question-authoring-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 0.22rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.exam-type-diagnostic { background: rgba(124, 58, 237, 0.14); border-color: rgba(124, 58, 237, 0.32); color: #c4b5fd; }
.exam-type-simu { background: rgba(14, 165, 233, 0.13); border-color: rgba(14, 165, 233, 0.28); color: #7dd3fc; }
.exam-type-practice { background: rgba(20, 184, 166, 0.13); border-color: rgba(20, 184, 166, 0.28); color: #5eead4; }
.exam-readiness-ready,
.question-authoring-ready,
.question-authoring-published { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.3); color: #86efac; }
.exam-readiness-review,
.question-authoring-needs_review { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.3); color: #fcd34d; }
.exam-readiness-badge[title] { cursor: help; }
.exam-readiness-help { display: inline-grid; place-items: center; width: 1.05em; height: 1.05em; margin-left: 0.12rem; border: 1px solid currentColor; border-radius: 50%; font-size: 0.78em; line-height: 1; }
.question-authoring-draft { background: rgba(148, 163, 184, 0.14); border-color: rgba(148, 163, 184, 0.3); color: #cbd5e1; }

body.light-theme .exam-type-diagnostic { color: #6d28d9; }
body.light-theme .exam-type-simu { color: #0369a1; }
body.light-theme .exam-type-practice { color: #0f766e; }
body.light-theme .exam-readiness-ready,
body.light-theme .question-authoring-ready,
body.light-theme .question-authoring-published { color: #15803d; }
body.light-theme .exam-readiness-review,
body.light-theme .question-authoring-needs_review { color: #a16207; }
body.light-theme .question-authoring-draft { color: #475569; }
body.light-theme .exam-inventory-filterbar,
body.light-theme .exam-question-management,
body.light-theme .question-metadata-editor { border-color: rgba(15, 23, 42, 0.12); }
body.light-theme .exam-inventory-table .form-control,
body.light-theme .exam-inventory-filterbar .form-control,
body.light-theme .exam-question-management .form-control,
body.light-theme .question-metadata-editor .form-control {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.16) !important;
  color: #0f172a !important;
}
body.dark-theme .exam-inventory-table .form-control,
body.dark-theme .exam-inventory-filterbar .form-control,
body.dark-theme .exam-question-management .form-control,
body.dark-theme .question-metadata-editor .form-control,
body:not(.light-theme) .exam-inventory-table .form-control,
body:not(.light-theme) .exam-inventory-filterbar .form-control,
body:not(.light-theme) .exam-question-management .form-control,
body:not(.light-theme) .question-metadata-editor .form-control {
  background: #111827 !important;
  border-color: rgba(226, 232, 240, 0.2) !important;
  color: #f8fafc !important;
  color-scheme: dark;
}

.exam-question-management-header { margin-bottom: 1rem; }
.exam-question-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.exam-question-kpis > div {
  padding: 0.75rem;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.06);
}
.exam-question-kpis span { display: block; color: var(--text-muted); font-size: 0.68rem; font-weight: 750; }
.exam-question-kpis strong { display: block; margin-top: 0.15rem; color: var(--text-primary); font-size: 1.2rem; }
.exam-question-filter-grid { grid-template-columns: minmax(190px, 2fr) repeat(3, minmax(115px, 1fr)) auto; margin-bottom: 1rem; }

.question-metadata-editor {
  padding: 1rem;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.06);
}
.question-metadata-editor-heading strong { display: block; color: var(--text-primary); font-size: 0.82rem; }
.question-metadata-editor-heading span { display: block; margin-top: 0.2rem; }
.question-metadata-editor-grid,
.exam-admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-top: 0.9rem; }

.exam-editor-readiness {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid;
  border-radius: 12px;
}
.exam-editor-readiness > div { display: flex; flex-direction: column; gap: 0.2rem; }
.exam-editor-readiness span { font-size: 0.72rem; }
.exam-editor-readiness.is-ready { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.3); color: #86efac; }
.exam-editor-readiness.needs-review { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.3); color: #fcd34d; }
body.light-theme .exam-editor-readiness.is-ready { color: #15803d; }
body.light-theme .exam-editor-readiness.needs-review { color: #a16207; }
.exam-editor-readiness-missing { max-width: 55%; color: inherit; text-align: right; }

.exam-admin-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
}
.exam-admin-modal-card {
  width: min(720px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  background: var(--bg-secondary, #111827);
  color: var(--text-primary);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}
body.light-theme .exam-admin-modal-card { background: #ffffff; }
.exam-admin-modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--glass-border); }
.exam-admin-modal-header h2 { margin: 0.15rem 0 0; font-size: 1.2rem; }
.exam-admin-modal-header p { max-width: 560px; margin: 0.25rem 0 0; color: var(--text-muted); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-admin-eyebrow { color: var(--accent-primary); font-size: 0.68rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.exam-admin-modal-close { width: 36px; height: 36px; border: 1px solid var(--glass-border); border-radius: 9px; background: transparent; color: var(--text-secondary); font-size: 1.35rem; cursor: pointer; }
.exam-admin-modal-body { padding: 1.5rem; }
.exam-admin-form-span-2 { grid-column: 1 / -1; }
.exam-admin-modal-actions { display: flex; justify-content: flex-end; gap: 0.65rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--glass-border); }
.exam-metadata-readiness { margin-top: 1rem; padding: 0.75rem; border: 1px solid; border-radius: 10px; font-size: 0.76rem; font-weight: 750; }
.exam-metadata-readiness.is-ready { border-color: rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.08); color: #86efac; }
.exam-metadata-readiness.needs-review { border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.08); color: #fcd34d; }
body.light-theme .exam-metadata-readiness.is-ready { color: #15803d; }
body.light-theme .exam-metadata-readiness.needs-review { color: #a16207; }
.exam-question-preview-prompt { margin: 0; color: var(--text-primary); font-size: 1rem; font-weight: 750; line-height: 1.6; }
.exam-question-preview-options { display: grid; gap: 0.55rem; margin-top: 1rem; }
.exam-question-preview-options > div { padding: 0.75rem; border: 1px solid var(--glass-border); border-radius: 9px; color: var(--text-secondary); }
.exam-question-preview-options > div.is-correct { border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.09); color: var(--text-primary); }
.exam-question-preview-explanation { margin-top: 1rem; padding: 0.85rem; border-radius: 10px; background: rgba(99, 102, 241, 0.07); }
.exam-question-preview-explanation p { margin: 0.3rem 0 0; font-size: 0.82rem; }

@media (max-width: 1180px) {
  .exam-inventory-filter-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .exam-inventory-table .exam-col-cover { display: none; }
}

@media (max-width: 900px) {
  .exam-inventory-filter-grid,
  .exam-question-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-part-management-layout { flex-direction: column; gap: 1rem !important; }
  .exam-part-management-layout > .exam-part-selector {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .exam-part-management-layout > .exam-part-selector h3 { grid-column: 1 / -1; }
  .exam-part-management-layout > .exam-question-management { width: 100%; min-width: 0 !important; }
  .exam-question-management { padding: 1rem !important; }
  .exam-question-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-question-table { min-width: 860px; }
  .exam-inventory-table { min-width: 980px; }
}

@media (max-width: 640px) {
  .exam-inventory-filter-grid,
  .exam-question-filter-grid,
  .question-metadata-editor-grid,
  .exam-admin-form-grid { grid-template-columns: 1fr; }
  .exam-admin-form-span-2 { grid-column: auto; }
  .exam-part-management-layout > .exam-part-selector { grid-template-columns: 1fr; }
  .exam-part-management-layout > .exam-part-selector h3 { grid-column: auto; }
  .exam-inventory-filter-summary,
  .exam-question-management-header,
  .question-metadata-editor-heading,
  .exam-admin-modal-header { align-items: flex-start; flex-direction: column; }
  .exam-editor-readiness-missing { max-width: none; text-align: left; }
}

/* STEP 6 — Diagnostic Result & Personalized Study Plan */
.diag-page{--diag-surface:rgba(20,24,38,.82);--diag-soft:rgba(255,255,255,.045);--diag-border:rgba(255,255,255,.1);--diag-copy:#e7eaf3;--diag-muted:#aeb7cc;--diag-accent:#8b7cff;max-width:1180px;margin:0 auto;padding:1.5rem clamp(1rem,3vw,2.5rem) 4rem;color:var(--diag-copy);font-family:"Sukhumvit Set","Noto Sans Thai",Tahoma,sans-serif}.light-theme .diag-page{--diag-surface:#fff;--diag-soft:#f6f7fb;--diag-border:#dfe3ed;--diag-copy:#172033;--diag-muted:#59657b;--diag-accent:#5b4de3}.diag-page *{box-sizing:border-box}.diag-page h1,.diag-page h2,.diag-page h3{font-family:"Sukhumvit Set","Noto Sans Thai",Tahoma,sans-serif;color:var(--diag-copy);margin-top:0}.diag-page button{font:inherit}.diag-hero,.diag-plan-header{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(250px,.5fr);gap:1.25rem;align-items:stretch;padding:clamp(1.5rem,4vw,3rem);border:1px solid var(--diag-border);border-radius:28px;background:linear-gradient(135deg,rgba(99,102,241,.19),rgba(168,85,247,.08)),var(--diag-surface);box-shadow:0 22px 55px rgba(5,8,18,.22)}.light-theme .diag-hero,.light-theme .diag-plan-header{background:linear-gradient(135deg,#f3f1ff,#fff)}.diag-hero h1,.diag-plan-header h1{font-size:clamp(1.75rem,4vw,3rem);line-height:1.1;margin:.55rem 0 .8rem}.diag-hero p,.diag-plan-header p{color:var(--diag-muted);line-height:1.65;margin:0;max-width:700px}.diag-eyebrow{color:#9d91ff;font-size:.72rem;font-weight:850;letter-spacing:.06em}.light-theme .diag-eyebrow{color:#5544cf}.diag-score,.diag-plan-time{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;border:1px solid rgba(139,124,255,.3);background:rgba(99,102,241,.11);border-radius:22px;padding:1.4rem}.diag-score span,.diag-plan-time span,.diag-stat span{font-size:.76rem;color:var(--diag-muted);font-weight:750}.diag-score strong,.diag-plan-time strong{font:800 clamp(1.8rem,5vw,3.4rem)/1 "Sukhumvit Set","Noto Sans Thai",Tahoma,sans-serif;color:var(--diag-copy);margin:.55rem 0}.diag-score small,.diag-plan-time small,.diag-stat small{color:var(--diag-muted);line-height:1.45}.diag-summary-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.85rem;margin:1rem 0 2rem}.diag-stat,.diag-card,.diag-skill-card,.diag-lesson-card{background:var(--diag-surface);border:1px solid var(--diag-border);border-radius:18px}.diag-stat{padding:1.1rem;display:flex;flex-direction:column;gap:.4rem;min-width:0}.diag-stat strong{font:800 1.16rem "Sukhumvit Set","Noto Sans Thai",Tahoma,sans-serif;color:var(--diag-copy);overflow-wrap:anywhere}.diag-warning{padding:1rem 1.2rem;margin:1rem 0 2rem;border:1px solid rgba(245,158,11,.42);border-radius:16px;background:rgba(245,158,11,.1);color:var(--diag-copy)}.diag-warning strong{color:#fbbf24}.light-theme .diag-warning strong{color:#8a4b00}.diag-warning ul{margin:.45rem 0 0;padding-left:1.15rem;color:var(--diag-muted);line-height:1.55}.diag-section{margin:2.2rem 0}.diag-section-title,.diag-row{display:flex;align-items:center;justify-content:space-between;gap:1rem}.diag-section-title{margin-bottom:1rem}.diag-section-title h2,.diag-section-title h3{margin:.25rem 0 0}.diag-section-actions{display:flex;align-items:center;justify-content:flex-end;gap:.55rem;flex-wrap:wrap}.diag-skill-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.9rem}.diag-skill-card{padding:1.15rem}.diag-skill-card p{color:var(--diag-muted);font-size:.78rem;line-height:1.5;margin:.75rem 0 0}.diag-progress{height:8px;background:var(--diag-soft);border-radius:99px;overflow:hidden;margin:.85rem 0}.diag-progress span{height:100%;display:block;background:linear-gradient(90deg,#7c6cff,#2dd4bf);border-radius:inherit}.diag-muted,.diag-meta{color:var(--diag-muted)!important;font-size:.77rem}.diag-badge{display:inline-flex;align-items:center;border:1px solid currentColor;border-radius:99px;padding:.24rem .55rem;font-size:.65rem;font-weight:800;text-transform:capitalize}.diag-badge.high,.diag-badge.essential{color:#ff8d9b;background:rgba(244,63,94,.1)}.light-theme .diag-badge.high,.light-theme .diag-badge.essential{color:#a31938}.diag-badge.medium,.diag-badge.recommended{color:#fbbf24;background:rgba(245,158,11,.1)}.light-theme .diag-badge.medium,.light-theme .diag-badge.recommended{color:#8a4b00}.diag-badge.low,.diag-badge.optional{color:#5eead4;background:rgba(20,184,166,.1)}.light-theme .diag-badge.low,.light-theme .diag-badge.optional{color:#08766a}.diag-two-col{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:2rem 0}.diag-card{padding:1.3rem}.diag-list{list-style:none;padding:0;margin:1rem 0 0;display:grid;gap:.65rem}.diag-list li{display:flex;flex-direction:column;gap:.18rem;padding:.8rem;border-radius:12px;background:var(--diag-soft);border-left:3px solid #2dd4bf}.diag-list.focus li{border-left-color:#fb7185}.diag-list span{color:var(--diag-muted);font-size:.78rem}.diag-plan-preview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.diag-plan-group{min-width:0}.diag-count{color:var(--diag-muted);font-size:.72rem;font-weight:750}.diag-lesson-card{padding:1rem;margin-bottom:.7rem}.diag-lesson-main{display:flex;justify-content:space-between;gap:1rem}.diag-lesson-card h3{font-size:.95rem;margin:.55rem 0 .25rem;overflow-wrap:anywhere}.diag-priority{color:var(--diag-muted);font-size:.68rem;white-space:nowrap}.diag-lesson-card details{border-top:1px solid var(--diag-border);margin-top:.8rem;padding-top:.75rem}.diag-lesson-card summary{cursor:pointer;color:#a99fff;font-size:.77rem;font-weight:750}.light-theme .diag-lesson-card summary{color:#5544cf}.diag-lesson-card details p{color:var(--diag-muted);font-size:.78rem;line-height:1.55}.diag-order{margin-top:1.3rem;padding:1.2rem;border-radius:18px;background:var(--diag-soft)}.diag-order ol{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.65rem}.diag-order li{display:flex;gap:.65rem;align-items:center;min-width:0}.diag-order li>span{display:grid;place-items:center;width:28px;height:28px;flex:0 0 auto;border-radius:50%;background:#6957df;color:#fff;font-weight:850}.diag-order li div{min-width:0}.diag-order li strong,.diag-order li small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.diag-order li small{color:var(--diag-muted);font-size:.68rem}.diag-actions{display:flex;align-items:center;justify-content:space-between;gap:1.25rem;margin-top:2rem;padding:1.4rem;border:1px solid var(--diag-border);border-radius:20px;background:var(--diag-surface)}.diag-actions h2{margin:0 0 .25rem;font-size:1.15rem}.diag-actions p{margin:0;color:var(--diag-muted);font-size:.8rem}.diag-action-buttons{display:flex;gap:.65rem;flex-wrap:wrap;justify-content:flex-end}.diag-btn{min-height:44px;border-radius:12px;padding:.7rem 1rem;font-weight:800;cursor:pointer;border:1px solid transparent;transition:transform .15s,opacity .15s,background .15s}.diag-btn:hover{transform:translateY(-1px)}.diag-btn:focus-visible,.diag-plan-tabs button:focus-visible,.diag-back-link:focus-visible{outline:3px solid rgba(139,124,255,.45);outline-offset:2px}.diag-btn:disabled{opacity:.62;cursor:wait;transform:none}.diag-btn-primary{background:linear-gradient(135deg,#6757e8,#8b5cf6);color:#fff;box-shadow:0 8px 20px rgba(99,102,241,.25)}.diag-btn-secondary{background:var(--diag-soft);color:var(--diag-copy);border-color:var(--diag-border)}.diag-btn-ghost,.diag-back-link{background:transparent;color:var(--diag-muted);border-color:transparent}.diag-action-status{color:#5eead4;font-size:.75rem;font-weight:700;margin-top:.35rem}.light-theme .diag-action-status{color:#08766a}.diag-state{max-width:650px;margin:8vh auto;text-align:center;padding:clamp(2rem,6vw,4rem)}.diag-state h1{margin:.8rem 0}.diag-state p{color:var(--diag-muted);line-height:1.6}.diag-state .diag-btn{margin:.4rem}.diag-state-icon{display:grid;place-items:center;width:58px;height:58px;border-radius:50%;background:rgba(99,102,241,.14);margin:auto;font-size:1.5rem;font-weight:900}.diag-state-inline{padding:2rem;text-align:center;border:1px dashed var(--diag-border);border-radius:16px;color:var(--diag-muted)}.diag-skeleton{height:160px;border-radius:18px;background:linear-gradient(90deg,var(--diag-soft),rgba(139,124,255,.12),var(--diag-soft));background-size:200% 100%;animation:diagShimmer 1.2s infinite}.diag-skeleton-hero{height:260px}.diag-loading-copy{text-align:center;color:var(--diag-muted)}@keyframes diagShimmer{to{background-position:-200% 0}}.diag-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem;margin-top:1rem}.diag-profile-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:.75rem;margin:1rem 0}.diag-profile-strip span{padding:1rem;border:1px solid var(--diag-border);border-radius:14px;background:var(--diag-surface)}.diag-profile-strip small,.diag-profile-strip strong{display:block}.diag-profile-strip small{color:var(--diag-muted);font-size:.7rem;margin-bottom:.35rem}.diag-plan-tabs{display:flex;gap:.6rem;margin:1.4rem 0;overflow-x:auto;padding-bottom:.25rem}.diag-plan-tabs button{min-width:150px;flex:1;padding:.8rem;border-radius:14px;border:1px solid var(--diag-border);background:var(--diag-soft);color:var(--diag-muted);font-weight:800;cursor:pointer}.diag-plan-tabs button.active{background:#6554df;color:#fff;border-color:#8b7cff}.diag-plan-tabs small{display:block;margin-top:.2rem;opacity:.8}.diag-plan-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(260px,.65fr);gap:1rem;align-items:start}.diag-lesson-list{max-height:none}.diag-schedule{position:sticky;top:1rem;max-height:72vh;overflow:auto}.diag-schedule-row{display:flex;flex-direction:column;gap:.18rem;padding:.75rem 0;border-bottom:1px solid var(--diag-border)}.diag-schedule-row span,.diag-schedule-row small{color:var(--diag-muted);font-size:.68rem}.diag-schedule-row.late{opacity:.7}.diag-back-link{cursor:pointer;padding:.4rem 0;margin-bottom:.75rem}
.study-plan-page-title{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}.study-plan-page-title h1{margin:.25rem 0;color:var(--diag-copy);font:850 clamp(1.8rem,4vw,2.5rem)/1.15 Outfit}.study-plan-page-title p{margin:0;color:var(--diag-muted)}.study-mode-toggle{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem;margin:1rem 0 1.5rem;padding:.35rem;border:1px solid var(--diag-border);border-radius:17px;background:var(--diag-soft)}.study-mode-toggle button{display:flex;flex-direction:column;align-items:flex-start;gap:.15rem;min-height:64px;padding:.8rem 1rem;border:1px solid transparent;border-radius:13px;background:transparent;color:var(--diag-muted);cursor:pointer;text-align:left}.study-mode-toggle button.active{border-color:rgba(139,124,255,.45);background:var(--diag-surface);color:var(--diag-copy);box-shadow:0 7px 18px rgba(15,23,42,.12)}.study-mode-toggle button:focus-visible,.study-open-lesson:focus-visible{outline:3px solid rgba(139,124,255,.45);outline-offset:2px}.study-mode-toggle strong{font-size:.86rem}.study-mode-toggle small{font-size:.69rem;color:var(--diag-muted)}.study-lesson-card{border:1px solid var(--diag-border);border-radius:17px;background:var(--diag-surface)}.study-lesson-badges{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}.study-progress-badge{display:inline-flex;border-radius:999px;padding:.24rem .55rem;font-size:.65rem;font-weight:800;color:var(--diag-muted);background:var(--diag-soft)}.study-progress-badge.in_progress{color:#fbbf24;background:rgba(245,158,11,.1)}.light-theme .study-progress-badge.in_progress{color:#8a4b00}.study-progress-badge.completed{color:#5eead4;background:rgba(20,184,166,.1)}.light-theme .study-progress-badge.completed{color:#08766a}.study-lesson-actions{display:flex;align-items:center;justify-content:space-between;gap:.8rem;margin-top:.85rem;padding-top:.8rem;border-top:1px solid var(--diag-border)}.study-lesson-actions .diag-btn{min-width:130px}.study-prerequisite,.study-unavailable{color:var(--diag-muted);font-size:.7rem;line-height:1.45}.study-prerequisite.pending{color:#fbbf24}.light-theme .study-prerequisite.pending{color:#8a4b00}.study-unavailable{padding:.5rem .7rem;border-radius:9px;background:var(--diag-soft)}
.study-freestyle-state{display:flex;flex-direction:column;align-items:center;gap:.7rem;max-width:680px;margin:1.5rem auto;padding:clamp(1.5rem,5vw,3rem);text-align:center}.study-freestyle-state h2{margin:0;color:var(--diag-copy);font:800 clamp(1.35rem,3vw,1.8rem)/1.2 Outfit}.study-freestyle-state p{max-width:540px;margin:0 0 .4rem;color:var(--diag-muted);line-height:1.7}.study-freestyle-badge,.teacher-plan-mode.freestyle{display:inline-flex;width:max-content;padding:.32rem .7rem;border:1px solid rgba(45,212,191,.35);border-radius:999px;background:rgba(20,184,166,.12);color:#5eead4;font-size:.68rem;font-weight:850;letter-spacing:.08em}.light-theme .study-freestyle-badge,.light-theme .teacher-plan-mode.freestyle{color:#08766a}.teacher-plan-freestyle-state{display:flex;flex-direction:column;align-items:flex-start;gap:.7rem;margin:1rem 1.25rem;padding:1.25rem;border:1px solid rgba(45,212,191,.28);border-radius:16px;background:rgba(20,184,166,.08)}.teacher-plan-freestyle-state>span{color:#5eead4;font-size:.68rem;font-weight:850;letter-spacing:.1em}.light-theme .teacher-plan-freestyle-state>span{color:#08766a}.teacher-plan-freestyle-state h3,.teacher-plan-freestyle-state p,.teacher-plan-freestyle-state small{margin:0}.teacher-plan-freestyle-state p,.teacher-plan-freestyle-state small{color:var(--text-muted);line-height:1.6}
.study-activity{margin:.35rem 0 0;color:var(--diag-muted);font-size:.7rem}.study-plan-view-tabs,.teacher-plan-detail-tabs{display:flex;gap:.45rem;margin:1.2rem 0;padding:.3rem;border:1px solid var(--diag-border);border-radius:14px;background:var(--diag-soft)}.study-plan-view-tabs button,.teacher-plan-detail-tabs button{flex:1;min-height:42px;padding:.6rem .75rem;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--diag-muted);font-weight:800;cursor:pointer}.study-plan-view-tabs button.active,.teacher-plan-detail-tabs button.active{border-color:rgba(139,124,255,.4);background:var(--diag-surface);color:var(--diag-copy);box-shadow:0 5px 14px rgba(15,23,42,.1)}.study-plan-view-tabs button:focus-visible,.teacher-plan-detail-tabs button:focus-visible,.study-plan-table-action:focus-visible{outline:3px solid rgba(139,124,255,.42);outline-offset:2px}.study-plan-overview-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem}.study-plan-overview-grid article{display:flex;flex-direction:column;gap:.3rem;padding:1rem;border:1px solid var(--diag-border);border-radius:15px;background:var(--diag-surface)}.study-plan-overview-grid span,.study-plan-overview-grid small{color:var(--diag-muted);font-size:.68rem}.study-plan-overview-grid strong{font:850 1.25rem Outfit;color:var(--diag-copy)}.study-plan-progress-track{height:9px;margin:1rem 0;border-radius:99px;background:var(--diag-soft);overflow:hidden}.study-plan-progress-track span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#6d5de7,#2dd4bf)}.study-plan-next-card{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1.2rem;border:1px solid rgba(139,124,255,.3);border-radius:17px;background:linear-gradient(135deg,rgba(99,102,241,.12),rgba(20,184,166,.06))}.study-plan-next-card span,.study-plan-next-card p{color:var(--diag-muted);font-size:.72rem}.study-plan-next-card h2,.study-plan-next-card p{margin:.25rem 0}.study-plan-table-wrap,.teacher-plan-schedule-table{overflow:auto;border:1px solid var(--diag-border);border-radius:16px;background:var(--diag-surface)}.study-plan-table,.teacher-plan-schedule-table table{width:100%;min-width:820px;border-collapse:collapse}.study-plan-table th,.teacher-plan-schedule-table th{padding:.75rem;text-align:left;background:var(--diag-soft);color:var(--diag-muted);font-size:.67rem}.study-plan-table td,.teacher-plan-schedule-table td{padding:.8rem;border-top:1px solid var(--diag-border);color:var(--diag-copy);font-size:.73rem;vertical-align:middle}.study-plan-table td strong,.study-plan-table td small,.teacher-plan-schedule-table td small{display:block}.study-plan-table td small,.teacher-plan-schedule-table td small{margin-top:.22rem;color:var(--diag-muted);font-size:.64rem}.study-plan-table tr.late,.teacher-plan-schedule-table tr.late{background:rgba(245,158,11,.07)}.study-plan-table-action{min-height:38px;padding:.5rem .7rem;border:1px solid rgba(139,124,255,.4);border-radius:9px;background:rgba(99,102,241,.12);color:#b6adff;font-weight:800;cursor:pointer;white-space:nowrap}.light-theme .study-plan-table-action{color:#5544cf}.study-plan-category-group{margin:1.5rem 0}.teacher-plan-detail-tabs{--diag-border:rgba(148,163,184,.22);--diag-soft:rgba(148,163,184,.07);--diag-surface:rgba(148,163,184,.1);--diag-muted:#aeb8cc;--diag-copy:#eef1f8}.light-theme .teacher-plan-detail-tabs{--diag-muted:#566279;--diag-copy:#172033}.teacher-plan-schedule-table{--diag-border:rgba(148,163,184,.2);--diag-soft:rgba(148,163,184,.07);--diag-surface:transparent;--diag-muted:#aeb8cc;--diag-copy:#eef1f8}.light-theme .teacher-plan-schedule-table{--diag-muted:#566279;--diag-copy:#172033}.teacher-plan-lesson-badges{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}
@media(max-width:980px){.diag-summary-grid{grid-template-columns:repeat(3,1fr)}.diag-plan-preview{grid-template-columns:1fr}.diag-order ol{grid-template-columns:repeat(2,1fr)}.diag-plan-layout{grid-template-columns:1fr}.diag-schedule{position:static;max-height:none}.study-plan-overview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.diag-page{padding:1rem .8rem 5rem}.diag-hero,.diag-plan-header{grid-template-columns:1fr;padding:1.25rem;border-radius:20px}.diag-score,.diag-plan-time{align-items:flex-start;text-align:left}.diag-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.diag-skill-grid,.diag-two-col,.diag-grid{grid-template-columns:1fr}.diag-profile-strip{grid-template-columns:repeat(2,1fr)}.diag-order ol{grid-template-columns:1fr}.diag-actions{align-items:stretch;flex-direction:column}.diag-action-buttons{display:grid;grid-template-columns:1fr;justify-content:stretch}.diag-btn{width:100%;min-height:48px}.diag-section-title{align-items:flex-start;flex-direction:column}.diag-section-title .diag-btn,.diag-section-actions{width:100%}.diag-section-actions{display:grid;grid-template-columns:1fr}.diag-lesson-main{flex-direction:column}.diag-plan-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible}.diag-plan-tabs button{min-width:0;padding:.72rem .35rem;font-size:.76rem}}
@media(max-width:700px){.study-plan-page-title{flex-direction:column}.study-plan-page-title>.diag-btn{width:auto}.study-mode-toggle{grid-template-columns:1fr}.study-lesson-actions{align-items:stretch;flex-direction:column}.study-lesson-actions .diag-btn{width:100%}.study-plan-view-tabs,.teacher-plan-detail-tabs{overflow-x:auto}.study-plan-view-tabs button,.teacher-plan-detail-tabs button{flex:0 0 auto;min-width:130px}.study-plan-next-card{align-items:stretch;flex-direction:column}.study-plan-next-card .diag-btn{width:100%}.study-plan-table-wrap,.teacher-plan-schedule-table{overflow:visible;border:0;background:transparent}.study-plan-table,.teacher-plan-schedule-table table{display:block;min-width:0}.study-plan-table thead,.teacher-plan-schedule-table thead{display:none}.study-plan-table tbody,.teacher-plan-schedule-table tbody{display:grid;gap:.7rem}.study-plan-table tr,.teacher-plan-schedule-table tr{display:grid;grid-template-columns:1fr 1fr;gap:.6rem;padding:.9rem;border:1px solid var(--diag-border);border-radius:14px;background:var(--diag-surface)}.study-plan-table td,.teacher-plan-schedule-table td{display:block;padding:0;border:0}.study-plan-table td:nth-child(2),.teacher-plan-schedule-table td:nth-child(2){grid-column:1/-1;grid-row:1}.study-plan-table td:last-child{text-align:right}.teacher-plan-schedule-table tr{border-color:rgba(148,163,184,.2);background:rgba(148,163,184,.05)}}
@media(max-width:390px){.diag-summary-grid,.diag-profile-strip{grid-template-columns:1fr}.diag-hero h1,.diag-plan-header h1{font-size:1.65rem}}
@media(prefers-reduced-motion:reduce){.diag-page *{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* STEP 7 — Student Dashboard Diagnostic Baseline */
.dash-diag-baseline{--ddb-surface:rgba(20,24,38,.84);--ddb-soft:rgba(255,255,255,.045);--ddb-border:rgba(255,255,255,.1);--ddb-copy:#eef1f8;--ddb-muted:#abb5c9;display:flex;flex-direction:column;gap:1rem;margin:1.25rem 0 1.5rem;padding:clamp(1.15rem,2.5vw,1.65rem);border:1px solid var(--ddb-border);border-radius:22px;background:linear-gradient(135deg,rgba(99,102,241,.14),rgba(20,184,166,.055)),var(--ddb-surface);box-shadow:0 16px 40px rgba(5,8,18,.16);color:var(--ddb-copy)}.light-theme .dash-diag-baseline{--ddb-surface:#fff;--ddb-soft:#f4f6fb;--ddb-border:#dce2ed;--ddb-copy:#172033;--ddb-muted:#566279;background:linear-gradient(135deg,#f5f3ff,#fff 52%,#f3fbfa)}.dash-diag-baseline *{box-sizing:border-box}.dash-diag-baseline h2{margin:.2rem 0 .35rem;color:var(--ddb-copy);font-size:clamp(1.15rem,2vw,1.45rem)}.dash-diag-baseline p{margin:0;color:var(--ddb-muted);font-size:.8rem;line-height:1.55}.dash-diag-eyebrow{color:#a99fff;font-size:.67rem;font-weight:850;letter-spacing:.12em}.light-theme .dash-diag-eyebrow{color:#5544cf}.dash-diag-head{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,300px);gap:1rem;align-items:stretch}.dash-diag-title-row{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap}.dash-diag-stale{border:1px solid #f59e0b;border-radius:999px;padding:.2rem .55rem;color:#fbbf24;background:rgba(245,158,11,.1);font-size:.63rem;font-weight:850}.light-theme .dash-diag-stale{color:#8a4b00}.dash-diag-score{display:flex;flex-direction:column;justify-content:center;padding:1rem 1.15rem;border:1px solid rgba(139,124,255,.3);border-radius:16px;background:rgba(99,102,241,.1)}.dash-diag-score span,.dash-diag-stats span,.dash-diag-insights>div>span,.dash-diag-next-copy>span{color:var(--ddb-muted);font-size:.68rem;font-weight:750}.dash-diag-score strong{margin:.25rem 0;color:var(--ddb-copy);font:850 clamp(1.25rem,2.5vw,1.8rem)/1.15 Outfit}.dash-diag-score small{color:var(--ddb-muted);font-size:.67rem;line-height:1.4}.dash-diag-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.7rem}.dash-diag-stats>div{min-width:0;padding:.85rem;border:1px solid var(--ddb-border);border-radius:13px;background:var(--ddb-soft)}.dash-diag-stats span,.dash-diag-stats strong{display:block}.dash-diag-stats strong{margin-top:.32rem;color:var(--ddb-copy);font-size:.88rem;overflow-wrap:anywhere}.dash-diag-insights{display:grid;grid-template-columns:1fr 1fr;gap:.7rem}.dash-diag-insights>div{padding:.85rem;border-radius:13px;background:var(--ddb-soft)}.dash-diag-chips{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:.45rem}.dash-diag-chips span{border:1px solid currentColor;border-radius:999px;padding:.24rem .55rem;font-size:.66rem;font-weight:800}.dash-diag-chips.focus span{color:#ff93a1;background:rgba(244,63,94,.09)}.light-theme .dash-diag-chips.focus span{color:#a31938}.dash-diag-chips.strength span{color:#5eead4;background:rgba(20,184,166,.09)}.light-theme .dash-diag-chips.strength span{color:#08766a}.dash-diag-next{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(180px,.5fr);gap:.85rem;align-items:center;padding:1rem;border:1px solid var(--ddb-border);border-radius:15px;background:var(--ddb-soft)}.dash-diag-next-copy{display:flex;min-width:0;flex-direction:column;gap:.22rem}.dash-diag-next-copy strong{color:var(--ddb-copy);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dash-diag-next-copy small{color:var(--ddb-muted);font-size:.7rem}.dash-diag-progress>div:first-child{display:flex;justify-content:space-between;gap:.5rem;color:var(--ddb-muted);font-size:.67rem}.dash-diag-progress-track{height:7px;margin-top:.4rem;border-radius:999px;background:rgba(127,138,163,.2);overflow:hidden}.dash-diag-progress-track>span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#6d5de7,#2dd4bf)}.dash-diag-actions{display:flex;align-items:center;gap:.55rem;flex-wrap:wrap}.dash-diag-actions #dash-diag-action-status{color:#5eead4;font-size:.7rem}.dash-diag-btn{min-height:42px;padding:.65rem .9rem;border:1px solid transparent;border-radius:11px;font:800 .76rem Inter;cursor:pointer;transition:transform .15s,opacity .15s}.dash-diag-btn:hover{transform:translateY(-1px)}.dash-diag-btn:focus-visible{outline:3px solid rgba(139,124,255,.45);outline-offset:2px}.dash-diag-btn:disabled{opacity:.62;cursor:wait;transform:none}.dash-diag-btn.primary{color:#fff;background:linear-gradient(135deg,#6554df,#8356e8);box-shadow:0 7px 18px rgba(99,102,241,.22)}.dash-diag-btn.secondary{color:var(--ddb-copy);border-color:var(--ddb-border);background:var(--ddb-soft)}.dash-diag-btn.ghost{color:var(--ddb-muted);background:transparent}.dash-diag-plan-pending{display:flex;gap:.4rem;flex-direction:column;padding:.9rem;border:1px dashed var(--ddb-border);border-radius:13px;color:var(--ddb-muted);font-size:.76rem}.dash-diag-plan-pending strong{color:var(--ddb-copy)}.dash-diag-empty,.dash-diag-unavailable{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center}.dash-diag-empty ul{display:flex;gap:1rem;flex-wrap:wrap;margin:.55rem 0 0;padding:0;list-style:none;color:var(--ddb-muted);font-size:.68rem}.dash-diag-empty li::before{content:'✓';margin-right:.3rem;color:#2dd4bf;font-weight:900}.dash-diag-empty-icon{display:grid;place-items:center;width:50px;height:50px;border-radius:15px;background:rgba(99,102,241,.14);color:#a99fff;font-size:1.4rem;font-weight:900}
.dash-diag-baseline .dash-diag-score{display:none}.dash-diag-baseline .dash-diag-head{grid-template-columns:minmax(0,1fr)}
.dash-diag-score-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.dash-diag-score-stats>div{padding:1.1rem 1.15rem}.dash-diag-score-stats span{font-size:.78rem}.dash-diag-score-stats strong{font-size:clamp(1.45rem,3vw,2.15rem);line-height:1.1}
.dash-diag-baseline{position:relative;isolation:isolate;overflow:hidden;border-color:rgba(99,102,241,.2);background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(245,243,255,.94) 50%,rgba(240,253,250,.94));box-shadow:0 14px 32px rgba(79,70,229,.1)}.dash-diag-baseline::before{content:'';position:absolute;inset:0 auto 0 0;z-index:-1;width:5px;background:linear-gradient(180deg,#6d5de7,#2dd4bf)}.dash-diag-baseline> *{position:relative;z-index:1}.dark-theme .dash-diag-baseline{border-color:rgba(129,140,248,.26);background:linear-gradient(135deg,rgba(30,41,59,.92),rgba(49,46,129,.34) 52%,rgba(15,118,110,.18));box-shadow:0 16px 38px rgba(15,23,42,.24)}.dash-diag-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.dash-diag-head-main{min-width:0;flex:1}.dash-diag-heading-line{display:flex;align-items:center;gap:.55rem;min-height:30px}.dash-diag-card-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:10px;color:#fff;background:linear-gradient(135deg,#6d5de7,#2dd4bf);box-shadow:0 7px 16px rgba(99,102,241,.2);font-size:.9rem;font-weight:900}.dash-diag-head-main h2{margin:.55rem 0 .35rem}.dash-diag-dismiss{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border:1px solid rgba(100,116,139,.22);border-radius:10px;color:var(--ddb-muted);background:rgba(148,163,184,.08);font:700 1.25rem/1 Inter;cursor:pointer;transition:background .16s ease,color .16s ease,transform .16s ease}.dash-diag-dismiss:hover{color:var(--ddb-copy);background:rgba(99,102,241,.14);transform:translateY(-1px)}.dash-diag-dismiss:focus-visible{outline:3px solid rgba(139,124,255,.45);outline-offset:2px}.dash-diag-score-stats>div:first-child strong{color:#5544cf}.dash-diag-score-stats>div:last-child strong{color:#b45309}.dark-theme .dash-diag-score-stats>div:first-child strong{color:#a99fff}.dark-theme .dash-diag-score-stats>div:last-child strong{color:#fbbf24}.dash-diag-plan-button{min-width:190px;padding:.72rem 1.15rem;font-size:.8rem;box-shadow:0 8px 20px rgba(99,102,241,.22)}
@media(max-width:900px){.dash-diag-head{grid-template-columns:1fr}.dash-diag-stats{grid-template-columns:repeat(2,1fr)}.dash-diag-next{grid-template-columns:minmax(0,1fr) auto}.dash-diag-progress{grid-column:1/-1}.dash-diag-empty,.dash-diag-unavailable{grid-template-columns:auto 1fr}.dash-diag-empty>.dash-diag-btn,.dash-diag-unavailable>.dash-diag-btn{grid-column:1/-1;width:100%}}
@media(max-width:560px){.dash-diag-baseline{margin:1rem 0;padding:1rem;border-radius:17px}.dash-diag-stats,.dash-diag-insights{grid-template-columns:1fr 1fr}.dash-diag-next,.dash-diag-plan-pending{order:1}.dash-diag-insights{order:2}.dash-diag-actions{order:3}.dash-diag-next{grid-template-columns:1fr}.dash-diag-next>.dash-diag-btn{width:100%}.dash-diag-actions{display:grid;grid-template-columns:1fr}.dash-diag-btn{width:100%;min-height:48px}.dash-diag-empty,.dash-diag-unavailable{grid-template-columns:1fr}.dash-diag-empty-icon{width:44px;height:44px}.dash-diag-empty ul{display:grid;gap:.35rem}}
@media(max-width:340px){.dash-diag-stats,.dash-diag-insights{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.dash-diag-baseline *{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* Teacher Study Plan Review — read-only quality panel */
.teacher-plan-page{--tpr-surface:rgba(20,24,38,.82);--tpr-soft:rgba(255,255,255,.045);--tpr-border:rgba(255,255,255,.1);--tpr-copy:#eef1f8;--tpr-muted:#aeb8cc;max-width:1440px;margin:0 auto;padding:1.25rem 1.25rem 5rem;color:var(--tpr-copy)}
.light-theme .teacher-plan-page{--tpr-surface:#fff;--tpr-soft:#f4f6fa;--tpr-border:#dbe2ed;--tpr-copy:#172033;--tpr-muted:#566279}
.teacher-plan-page *{box-sizing:border-box}.teacher-plan-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;padding:1.35rem 1.5rem;border:1px solid var(--tpr-border);border-radius:22px;background:linear-gradient(135deg,rgba(99,102,241,.15),rgba(20,184,166,.055)),var(--tpr-surface)}
.teacher-plan-eyebrow{color:#aaa1ff;font-size:.67rem;font-weight:850;letter-spacing:.11em}.light-theme .teacher-plan-eyebrow{color:#5544cf}.teacher-plan-hero h1{margin:.25rem 0 .35rem;color:var(--tpr-copy);font:850 clamp(1.7rem,4vw,2.35rem)/1.15 Outfit}.teacher-plan-hero p{margin:0;color:var(--tpr-muted);font-size:.82rem;line-height:1.55}.teacher-plan-engine{flex:0 0 auto;padding:.5rem .7rem;border:1px solid rgba(45,212,191,.35);border-radius:999px;color:#5eead4;background:rgba(20,184,166,.09);font-size:.68rem;font-weight:800}.light-theme .teacher-plan-engine{color:#08766a}
.teacher-plan-tabs{display:flex;gap:.55rem;margin:1rem 0 1.25rem;padding:.35rem;border:1px solid var(--tpr-border);border-radius:15px;background:var(--tpr-soft);overflow-x:auto}.teacher-plan-tabs button{min-height:42px;padding:.6rem 1rem;border:1px solid transparent;border-radius:11px;background:transparent;color:var(--tpr-muted);font-weight:800;white-space:nowrap;cursor:pointer}.teacher-plan-tabs button.active{border-color:rgba(139,124,255,.45);background:var(--tpr-surface);color:var(--tpr-copy);box-shadow:0 6px 16px rgba(15,23,42,.12)}.teacher-plan-tabs button span{margin-left:.3rem;padding:.1rem .4rem;border-radius:999px;background:rgba(139,124,255,.14)}
.teacher-plan-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.75rem}.teacher-plan-summary article,.teacher-plan-panel{padding:1rem;border:1px solid var(--tpr-border);border-radius:16px;background:var(--tpr-surface)}.teacher-plan-summary span,.teacher-plan-summary strong{display:block}.teacher-plan-summary span{min-height:2.4em;color:var(--tpr-muted);font-size:.7rem;line-height:1.4}.teacher-plan-summary strong{margin-top:.35rem;color:var(--tpr-copy);font:850 1.65rem/1 Outfit}.teacher-plan-summary .attention{border-color:rgba(245,158,11,.35);background:rgba(245,158,11,.07)}.teacher-plan-overview-grid{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:1rem;margin-top:1rem}.teacher-plan-section-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.8rem}.teacher-plan-section-head h2,.teacher-plan-section-head h3{margin:0;color:var(--tpr-copy);font-size:1rem}.teacher-plan-section-head>span{color:var(--tpr-muted);font-size:.67rem}.teacher-plan-text-btn{border:0;background:transparent;color:#aaa1ff;font-weight:800;cursor:pointer}.light-theme .teacher-plan-text-btn{color:#5544cf}
.teacher-plan-skill-ranking{list-style:none;margin:0;padding:0;display:grid;gap:.45rem}.teacher-plan-skill-ranking li{display:flex;justify-content:space-between;gap:.7rem;padding:.65rem .75rem;border-radius:10px;background:var(--tpr-soft);font-size:.78rem}.teacher-plan-skill-ranking strong{color:#5eead4}.light-theme .teacher-plan-skill-ranking strong{color:#08766a}.teacher-plan-review-item{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;margin:.4rem 0;padding:.7rem;border:1px solid var(--tpr-border);border-radius:11px;background:var(--tpr-soft);color:var(--tpr-copy);text-align:left;cursor:pointer}.teacher-plan-review-item span:first-child{min-width:0}.teacher-plan-review-item strong,.teacher-plan-review-item small{display:block}.teacher-plan-review-item small{margin-top:.18rem;color:var(--tpr-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.68rem}
.teacher-plan-filters{display:grid;grid-template-columns:minmax(240px,1fr) minmax(180px,.35fr) auto;gap:.7rem;align-items:end;margin-bottom:1rem;padding:1rem;border:1px solid var(--tpr-border);border-radius:15px;background:var(--tpr-soft)}.teacher-plan-filters label{display:flex;flex-direction:column;gap:.35rem;color:var(--tpr-muted);font-size:.68rem;font-weight:800}.teacher-plan-filters input,.teacher-plan-filters select,.teacher-plan-filters button{min-height:44px;border:1px solid var(--tpr-border);border-radius:10px}.teacher-plan-filters input,.teacher-plan-filters select{width:100%;padding:.65rem .75rem;background:var(--tpr-surface);color:var(--tpr-copy)}.teacher-plan-filters button,.teacher-plan-detail-btn,.teacher-plan-link{padding:.65rem .85rem;background:#6554df;color:#fff;border:0;border-radius:10px;font-weight:800;cursor:pointer}.teacher-plan-tabs button:focus-visible,.teacher-plan-filters input:focus-visible,.teacher-plan-filters select:focus-visible,.teacher-plan-filters button:focus-visible,.teacher-plan-detail-btn:focus-visible,.teacher-plan-link:focus-visible,.teacher-plan-close:focus-visible{outline:3px solid rgba(139,124,255,.45);outline-offset:2px}
.teacher-plan-table-wrap{overflow:auto;border:1px solid var(--tpr-border);border-radius:16px;background:var(--tpr-surface)}.teacher-plan-table{width:100%;min-width:1050px;border-collapse:collapse}.teacher-plan-table th{padding:.8rem;text-align:left;color:var(--tpr-muted);background:var(--tpr-soft);font-size:.67rem}.teacher-plan-table td{padding:.85rem;border-top:1px solid var(--tpr-border);vertical-align:middle;font-size:.75rem}.teacher-plan-table td>strong,.teacher-plan-table td>small{display:block}.teacher-plan-table td>small{margin-top:.22rem;color:var(--tpr-muted);font-size:.65rem}.teacher-plan-next{max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.teacher-plan-progress{width:100%;height:5px;margin:.35rem 0;border-radius:999px;background:var(--tpr-soft);overflow:hidden}.teacher-plan-progress span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#6d5de7,#2dd4bf)}.teacher-plan-status{display:inline-flex;padding:.28rem .52rem;border:1px solid currentColor;border-radius:999px;font-size:.62rem;font-weight:850;white-space:nowrap}.teacher-plan-status.ready{color:#5eead4;background:rgba(20,184,166,.09)}.teacher-plan-status.review{color:#fbbf24;background:rgba(245,158,11,.09)}.teacher-plan-status.critical{color:#ff93a1;background:rgba(244,63,94,.09)}.teacher-plan-status.pending{color:var(--tpr-muted);background:var(--tpr-soft)}.light-theme .teacher-plan-status.ready{color:#08766a}.light-theme .teacher-plan-status.review{color:#8a4b00}.light-theme .teacher-plan-status.critical{color:#a31938}.teacher-plan-chips{display:flex;gap:.3rem;flex-wrap:wrap}.teacher-plan-chip,.teacher-plan-chips>span{display:inline-flex;padding:.25rem .48rem;border:1px solid currentColor;border-radius:999px;font-size:.62rem;font-weight:800}.teacher-plan-chips.focus>span{color:#ff93a1;background:rgba(244,63,94,.08)}.teacher-plan-chips.strength>span{color:#5eead4;background:rgba(20,184,166,.08)}.light-theme .teacher-plan-chips.focus>span{color:#a31938}.light-theme .teacher-plan-chips.strength>span{color:#08766a}.teacher-plan-chips .muted{color:var(--tpr-muted)}
.teacher-plan-readonly{display:flex;gap:.6rem;align-items:center;padding:.9rem 1rem;border:1px solid rgba(139,124,255,.35);border-radius:14px;background:rgba(99,102,241,.08)}.teacher-plan-readonly strong{color:#aaa1ff}.light-theme .teacher-plan-readonly strong{color:#5544cf}.teacher-plan-readonly span{color:var(--tpr-muted);font-size:.75rem}.teacher-plan-rule-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;margin-top:1rem}.teacher-plan-rule-grid article{padding:1rem;border:1px solid var(--tpr-border);border-radius:14px;background:var(--tpr-surface)}.teacher-plan-rule-grid h3{margin:0 0 .45rem;color:var(--tpr-copy);font-size:.9rem}.teacher-plan-rule-grid p{margin:0;color:var(--tpr-muted);font-size:.75rem;line-height:1.6}
.teacher-plan-strategy-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem;margin-top:1rem}.teacher-plan-strategy-grid button{display:flex;flex-direction:column;align-items:flex-start;gap:.3rem;min-height:150px;padding:1rem;border:1px solid var(--tpr-border);border-radius:15px;background:linear-gradient(145deg,rgba(99,102,241,.09),transparent),var(--tpr-surface);color:var(--tpr-copy);text-align:left;cursor:pointer;transition:transform .15s,border-color .15s}.teacher-plan-strategy-grid button:hover{transform:translateY(-2px);border-color:rgba(139,124,255,.5)}.teacher-plan-strategy-grid button:focus-visible{outline:3px solid rgba(139,124,255,.45);outline-offset:2px}.teacher-plan-strategy-grid span{color:#aaa1ff;font-size:.62rem;font-weight:850;letter-spacing:.1em}.light-theme .teacher-plan-strategy-grid span{color:#5544cf}.teacher-plan-strategy-grid strong{margin-top:.2rem;font-size:1rem}.teacher-plan-strategy-grid small{color:var(--tpr-muted);font-size:.7rem;line-height:1.5}.teacher-plan-strategy-grid em{margin-top:auto;color:#aaa1ff;font-size:.7rem;font-style:normal;font-weight:800}.light-theme .teacher-plan-strategy-grid em{color:#5544cf}.teacher-plan-guidance-flow{display:grid;gap:.7rem;margin:1rem 0}.teacher-plan-guidance-flow article{display:grid;grid-template-columns:34px minmax(0,1fr);gap:.75rem;padding:.85rem;border:1px solid rgba(148,163,184,.2);border-radius:12px;background:rgba(148,163,184,.055)}.teacher-plan-guidance-flow article>span{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:rgba(99,102,241,.18);color:#c4bfff;font-weight:850}.light-theme .teacher-plan-guidance-flow article>span{color:#5544cf}.teacher-plan-guidance-flow article.warning{border-color:rgba(245,158,11,.35);background:rgba(245,158,11,.07)}.teacher-plan-guidance-flow article.warning>span{background:rgba(245,158,11,.18);color:#fbbf24}.light-theme .teacher-plan-guidance-flow article.warning>span{color:#8a4b00}.teacher-plan-guidance-flow h3{margin:0 0 .3rem;color:inherit;font-size:.85rem}.teacher-plan-guidance-flow p,.teacher-plan-guidance-note p{margin:0;color:#aeb8cc;font-size:.73rem;line-height:1.6}.light-theme .teacher-plan-guidance-flow p,.light-theme .teacher-plan-guidance-note p{color:#566279}.teacher-plan-guidance-note{padding:1rem;border:1px dashed rgba(139,124,255,.38);border-radius:12px;background:rgba(99,102,241,.07)}.teacher-plan-guidance-note strong{display:block;margin-bottom:.35rem;color:#aaa1ff}.light-theme .teacher-plan-guidance-note strong{color:#5544cf}
.teacher-plan-drawer-backdrop{position:fixed;inset:0;z-index:11000;background:rgba(5,8,18,.62);backdrop-filter:blur(4px)}.teacher-plan-drawer{position:fixed;top:0;right:0;bottom:0;z-index:11001;width:min(720px,94vw);overflow:auto;padding:1.2rem;background:#151927;color:#eef1f8;box-shadow:-24px 0 70px rgba(0,0,0,.35)}.light-theme .teacher-plan-drawer{background:#fff;color:#172033}.teacher-plan-drawer>header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;padding-bottom:1rem;border-bottom:1px solid rgba(148,163,184,.2)}.teacher-plan-drawer h2{margin:.2rem 0;color:inherit}.teacher-plan-drawer header p{margin:0;color:#aeb8cc;font-size:.75rem}.light-theme .teacher-plan-drawer header p{color:#566279}.teacher-plan-close{width:42px;height:42px;border:1px solid rgba(148,163,184,.25);border-radius:11px;background:rgba(148,163,184,.08);color:inherit;font-size:1.45rem;cursor:pointer}.teacher-plan-profile{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.6rem;margin:1rem 0}.teacher-plan-profile>div{padding:.8rem;border:1px solid rgba(148,163,184,.2);border-radius:12px;background:rgba(148,163,184,.06)}.teacher-plan-profile span,.teacher-plan-profile strong,.teacher-plan-profile small{display:block}.teacher-plan-profile span,.teacher-plan-profile small{color:#aeb8cc;font-size:.65rem}.light-theme .teacher-plan-profile span,.light-theme .teacher-plan-profile small{color:#566279}.teacher-plan-profile strong{margin:.3rem 0;font-size:.95rem}.teacher-plan-detail-section{margin-top:1rem;padding:1rem;border:1px solid rgba(148,163,184,.2);border-radius:14px}.teacher-plan-detail-section>h3{margin:0 0 .75rem}.teacher-plan-insight-grid{display:grid;grid-template-columns:1fr 1fr;gap:.65rem}.teacher-plan-insight-grid>div{padding:.75rem;border-radius:11px;background:rgba(148,163,184,.07)}.teacher-plan-insight-grid>div>span{display:block;margin-bottom:.45rem;color:#aeb8cc;font-size:.68rem}.light-theme .teacher-plan-insight-grid>div>span{color:#566279}.teacher-plan-issues{list-style:none;margin:0;padding:0;display:grid;gap:.5rem}.teacher-plan-issues li{display:flex;gap:.6rem;padding:.65rem;border-left:3px solid #f59e0b;border-radius:8px;background:rgba(245,158,11,.07);font-size:.72rem}.teacher-plan-issues li.critical{border-left-color:#f43f5e;background:rgba(244,63,94,.07)}.teacher-plan-success,.teacher-plan-empty-inline{padding:1rem;border:1px dashed rgba(148,163,184,.3);border-radius:12px;color:#aeb8cc;text-align:center;font-size:.75rem}.light-theme .teacher-plan-success,.light-theme .teacher-plan-empty-inline{color:#566279}.teacher-plan-lesson{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.75rem;margin:.65rem 0;padding:.85rem;border:1px solid rgba(148,163,184,.2);border-radius:12px;background:rgba(148,163,184,.05)}.teacher-plan-lesson h4{margin:.35rem 0 .2rem;color:inherit}.teacher-plan-lesson p{margin:0;color:#aeb8cc;font-size:.68rem;line-height:1.5}.light-theme .teacher-plan-lesson p{color:#566279}.teacher-plan-category{display:inline-flex;padding:.22rem .45rem;border:1px solid currentColor;border-radius:999px;font-size:.59rem;font-weight:850}.teacher-plan-category.essential{color:#ff93a1}.teacher-plan-category.recommended{color:#fbbf24}.teacher-plan-category.optional{color:#5eead4}.light-theme .teacher-plan-category.essential{color:#a31938}.light-theme .teacher-plan-category.recommended{color:#8a4b00}.light-theme .teacher-plan-category.optional{color:#08766a}.teacher-plan-lesson-side{display:flex;flex-direction:column;align-items:flex-end;gap:.4rem;color:#aeb8cc;font-size:.65rem}.teacher-plan-link{padding:.5rem .65rem}.teacher-plan-lesson details{grid-column:1/-1;border-top:1px solid rgba(148,163,184,.2);padding-top:.6rem}.teacher-plan-lesson summary{color:#aaa1ff;font-size:.7rem;font-weight:800;cursor:pointer}.light-theme .teacher-plan-lesson summary{color:#5544cf}.teacher-plan-missing{grid-column:1/-1;color:#ff93a1!important}.teacher-plan-state{max-width:650px;margin:8vh auto;padding:2rem;border:1px solid var(--glass-border);border-radius:18px;background:var(--glass-bg);color:var(--text-primary);text-align:center}.teacher-plan-state p{color:var(--text-secondary)}.teacher-plan-state.compact{margin:1rem auto}
.teacher-plan-lesson h4{overflow-wrap:anywhere;word-break:break-word;line-height:1.45}
@media(max-width:1050px){.teacher-plan-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.teacher-plan-overview-grid{grid-template-columns:1fr}.teacher-plan-profile{grid-template-columns:repeat(2,minmax(0,1fr))}.teacher-plan-strategy-grid{grid-template-columns:1fr}.teacher-plan-strategy-grid button{min-height:120px}}
@media(max-width:700px){.teacher-plan-page{padding:.8rem .65rem 5rem}.teacher-plan-hero{flex-direction:column;padding:1rem}.teacher-plan-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.teacher-plan-filters{grid-template-columns:1fr}.teacher-plan-rule-grid,.teacher-plan-insight-grid{grid-template-columns:1fr}.teacher-plan-readonly{align-items:flex-start;flex-direction:column}.teacher-plan-drawer{width:100vw;padding:.9rem}.teacher-plan-profile{grid-template-columns:repeat(2,minmax(0,1fr))}.teacher-plan-lesson{grid-template-columns:1fr}.teacher-plan-lesson-side{align-items:stretch}.teacher-plan-link{min-height:44px}.teacher-plan-summary article:last-child{grid-column:1/-1}}
@media(max-width:380px){.teacher-plan-summary,.teacher-plan-profile{grid-template-columns:1fr}.teacher-plan-summary article:last-child{grid-column:auto}}
@media(prefers-reduced-motion:reduce){.teacher-plan-page *{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* STEP 8 — Immediate interaction feedback and route progress */
#app-main.view-is-navigating::before{content:'';position:fixed;z-index:12000;top:0;left:0;width:38%;height:3px;background:linear-gradient(90deg,#6366f1,#2dd4bf);box-shadow:0 0 12px rgba(99,102,241,.45);animation:step8-route-progress .8s ease-in-out infinite alternate;pointer-events:none}
button[aria-busy="true"],.btn[aria-busy="true"]{cursor:wait!important;opacity:.72;pointer-events:none}
button:disabled,.btn:disabled{cursor:not-allowed}
.auth-tab[aria-disabled="true"]{opacity:.58;pointer-events:none}
[data-action-pending="true"]{position:relative;cursor:wait!important;pointer-events:none}
button[data-action-pending="true"]::after,.btn[data-action-pending="true"]::after,a[data-action-pending="true"]::after{content:'';position:absolute;right:.72rem;top:50%;width:.86em;height:.86em;margin-top:-.43em;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;opacity:.9;pointer-events:none;animation:step8-action-spinner .72s linear infinite}
a.sidebar-link[data-action-pending="true"]::after{right:.55rem}
[data-tab-clicked="true"]{position:relative;z-index:1;outline:2px solid rgba(99,102,241,.42);outline-offset:-2px;transform:translateY(-.5px);animation:step8-tab-clicked .36s ease-out}
@keyframes step8-action-spinner{to{transform:rotate(360deg)}}
@keyframes step8-tab-clicked{0%{filter:brightness(1.16)}100%{filter:brightness(1)}}
@keyframes step8-route-progress{from{transform:translateX(-35vw)}to{transform:translateX(210vw)}}
@media(prefers-reduced-motion:reduce){#app-main.view-is-navigating::before{animation:none;width:100%}[data-action-pending="true"]::after{animation:none}[data-tab-clicked="true"]{animation:none}}

/* Practice Test submit confirmation */
.exam-submit-confirmation{position:fixed;inset:0;z-index:10050;display:grid;place-items:center;padding:1rem;background:rgba(15,23,42,.62);backdrop-filter:blur(6px)}
.exam-submit-confirmation__panel{width:min(100%,440px);padding:1.5rem;border:1px solid var(--border-color,rgba(148,163,184,.3));border-radius:1.25rem;background:var(--surface-color,#fff);color:var(--text-primary,#0f172a);box-shadow:0 24px 70px rgba(15,23,42,.28)}
.exam-submit-confirmation__panel h2{margin:0 0 .65rem;font-size:1.15rem}.exam-submit-confirmation__panel p{margin:0;color:var(--text-secondary,#475569);line-height:1.6}
.exam-submit-confirmation__actions{display:flex;justify-content:flex-end;gap:.75rem;margin-top:1.25rem}
@media(max-width:560px){.exam-submit-confirmation__actions{flex-direction:column-reverse}.exam-submit-confirmation__actions .btn{width:100%}}

/* Study Plan + Diagnostic Result — unified student learning module */
.study-module-page{max-width:1240px;font-family:"Sukhumvit Set","Noto Sans Thai",Tahoma,sans-serif;animation:study-page-enter .22s cubic-bezier(.2,.8,.2,1) both}
.study-module-page h1,.study-module-page h2,.study-module-page h3,.study-module-page strong,.study-module-page button{font-family:inherit}
.study-module-tabs{display:inline-flex;gap:.25rem;margin:0 0 1.1rem;padding:.3rem;border:1px solid var(--diag-border);border-radius:14px;background:var(--diag-soft)}
.study-module-tabs button{min-height:42px;padding:.6rem 1.1rem;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--diag-muted);font-weight:800;cursor:pointer;transition:color .16s ease,background .16s ease,border-color .16s ease,transform .16s ease}
.study-module-tabs button.active{border-color:rgba(139,124,255,.42);background:var(--diag-surface);color:var(--diag-copy);box-shadow:0 5px 14px rgba(15,23,42,.1)}
.study-module-tabs button:active{transform:translateY(1px)}
.study-module-tabs button:focus-visible,.study-mode-toggle button:focus-visible{outline:3px solid rgba(139,124,255,.42);outline-offset:2px}
.study-module-header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1.2rem}
.study-module-header h1{margin:0;color:var(--diag-copy);font-size:clamp(1.8rem,4vw,2.65rem);line-height:1.18}
.study-module-header p{margin:.4rem 0 0;color:var(--diag-muted);font-size:.86rem;line-height:1.55}
.study-module-header small{display:block;margin-top:.25rem;color:var(--diag-muted);font-size:.72rem;line-height:1.5}
.study-module-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:.55rem;flex-wrap:wrap}.study-plan-settings-button{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:42px;padding:.62rem .9rem;border:1px solid rgba(129,114,239,.4);border-radius:11px;background:rgba(99,102,241,.1);color:#a99fff;font-size:.74rem;font-weight:850;white-space:nowrap;cursor:pointer;transition:transform .16s ease,border-color .16s ease,background .16s ease}.study-plan-settings-button:hover{transform:translateY(-1px);border-color:#8b7cff;background:rgba(99,102,241,.18)}.study-plan-settings-button:focus-visible{outline:3px solid rgba(139,124,255,.4);outline-offset:2px}.study-plan-settings-button svg{flex:0 0 auto}.light-theme .study-plan-settings-button{color:#5544cf;background:#f4f1ff;border-color:#cfc7ff}.light-theme .study-plan-settings-button:hover{background:#ebe7ff}

/* Diagnostic result */
.diag-foundation-card{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(150px,.5fr);align-items:stretch;border:1px solid var(--diag-border);border-radius:20px;background:var(--diag-surface);box-shadow:0 12px 34px rgba(15,23,42,.08);overflow:hidden}
.diag-foundation-main{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;align-content:center;column-gap:1rem;padding:1.35rem 1.5rem}
.diag-foundation-main>span,.diag-foundation-metric>span{color:var(--diag-muted);font-size:.72rem;font-weight:750}
.diag-foundation-main h2{grid-column:1/-1;margin:.25rem 0;color:#f59e0b;font-size:clamp(1.45rem,3vw,2rem)}
.light-theme .diag-foundation-main h2{color:#a75300}
.diag-foundation-main p{grid-column:1/-1;margin:0 0 .9rem;color:var(--diag-muted);font-size:.8rem}
.diag-foundation-main>strong{align-self:center;color:var(--diag-copy);font-size:1.15rem}
.diag-result-progress{align-self:center;height:9px;border-radius:999px;background:var(--diag-soft);overflow:hidden}
.diag-result-progress>span,.diag-progress>span,.study-progress-visual span{display:block;width:var(--progress,0%);height:100%;border-radius:inherit;background:linear-gradient(90deg,#f59e0b,#2dd4bf);transform-origin:left;animation:study-progress-grow .55s cubic-bezier(.2,.8,.2,1) both}
.diag-foundation-metric{display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:0;padding:1.2rem;border-left:1px solid var(--diag-border);text-align:center}
.diag-foundation-metric strong{margin:.35rem 0;color:var(--diag-copy);font-size:clamp(1.25rem,2.8vw,2rem);overflow-wrap:anywhere}
.diag-foundation-metric small{color:var(--diag-muted);font-size:.67rem;line-height:1.45}
.diag-result-note{display:flex;align-items:flex-start;gap:.75rem;margin:1rem 0 1.6rem;padding:.85rem 1rem;border:1px solid rgba(96,165,250,.3);border-radius:13px;background:rgba(59,130,246,.07)}
.diag-result-note::before{content:'i';display:grid;place-items:center;flex:0 0 22px;width:22px;height:22px;border-radius:50%;background:#5b4de3;color:#fff;font-size:.72rem;font-weight:900}
.diag-result-note strong,.diag-result-note span{display:block}.diag-result-note strong{color:var(--diag-copy);font-size:.75rem}.diag-result-note span{margin-top:.12rem;color:var(--diag-muted);font-size:.71rem;line-height:1.5}
.diag-focus-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.diag-focus-grid .diag-skill-card{position:relative;padding:1.1rem;border-color:rgba(245,158,11,.25);background:linear-gradient(145deg,rgba(245,158,11,.06),transparent),var(--diag-surface);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.diag-focus-grid .diag-skill-card:hover{transform:translateY(-2px);border-color:rgba(245,158,11,.42);box-shadow:0 10px 25px rgba(15,23,42,.08)}
.diag-focus-grid .diag-skill-card p{min-height:3.1em}
.diag-insight-columns .diag-card{padding:1.2rem}.diag-insight-columns .diag-section-title{margin-bottom:.55rem}.diag-insight-columns h2{font-size:1rem}
.diag-list.neutral li{border-left-color:#94a3b8}
.diag-start-lesson-list{list-style:none;margin:0;padding:0;border:1px solid var(--diag-border);border-radius:16px;background:var(--diag-surface);overflow:hidden}
.diag-start-lesson-list li{display:grid;grid-template-columns:36px minmax(0,1fr);gap:.85rem;padding:1rem 1.15rem;border-top:1px solid var(--diag-border)}
.diag-start-lesson-list li:first-child{border-top:0}
.diag-start-lesson-list li>span{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#6554df;color:#fff;font-weight:850}
.diag-start-lesson-list strong,.diag-start-lesson-list small{display:block}.diag-start-lesson-list strong{color:var(--diag-copy);font-size:.9rem}.diag-start-lesson-list small{margin-top:.18rem;color:var(--diag-muted);font-size:.7rem}.diag-start-lesson-list p{margin:.35rem 0 0;color:var(--diag-muted);font-size:.72rem;line-height:1.5}
.diag-result-actions{display:flex;align-items:center;justify-content:center;gap:1rem;margin-top:1rem}.diag-result-actions>.diag-btn{min-width:210px}
.diag-full-detail{color:var(--diag-muted);font-size:.74rem}.diag-full-detail summary{padding:.55rem;cursor:pointer;font-weight:800}.diag-full-detail>div{padding:.75rem;border:1px solid var(--diag-border);border-radius:12px;background:var(--diag-soft)}.diag-full-detail p{margin:0 0 .65rem;line-height:1.55}

/* Student learning-plan settings */
.student-plan-settings{--settings-surface:rgba(15,23,42,.72);--settings-soft:rgba(148,163,184,.08);--settings-border:rgba(148,163,184,.18);--settings-copy:#f8fafc;--settings-muted:#94a3b8;width:min(1100px,100%);margin:0 auto;padding:1.6rem 1.35rem 5rem}
.light-theme .student-plan-settings{--settings-surface:#fff;--settings-soft:#f5f7fb;--settings-border:#e4e8f0;--settings-copy:#172033;--settings-muted:#67728a}
.student-settings-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem;margin-bottom:1.15rem}.student-settings-eyebrow{display:block;margin-bottom:.35rem;color:#8b7cff;font-size:.68rem;font-weight:900;letter-spacing:.12em}.student-settings-hero h1{margin:0;color:var(--settings-copy);font-size:clamp(1.75rem,4vw,2.5rem);line-height:1.15}.student-settings-hero p{max-width:700px;margin:.55rem 0 0;color:var(--settings-muted);font-size:.82rem;line-height:1.65}.student-settings-back{min-height:40px;padding:.55rem .9rem;border:1px solid var(--settings-border);border-radius:11px;background:var(--settings-soft);color:var(--settings-copy);font-size:.72rem;font-weight:800;cursor:pointer}
.student-settings-overview{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem;margin-bottom:1rem}.student-settings-overview article{padding:1rem 1.05rem;border:1px solid var(--settings-border);border-radius:15px;background:var(--settings-surface);box-shadow:0 8px 24px rgba(15,23,42,.06)}.student-settings-overview span,.student-settings-overview strong,.student-settings-overview small{display:block}.student-settings-overview span{color:var(--settings-muted);font-size:.65rem;font-weight:700}.student-settings-overview strong{margin:.24rem 0;color:var(--settings-copy);font-size:1.1rem}.student-settings-overview small{color:var(--settings-muted);font-size:.62rem}
.student-settings-form{display:grid;gap:.9rem}.student-settings-card{padding:1.25rem;border:1px solid var(--settings-border);border-radius:18px;background:var(--settings-surface);box-shadow:0 10px 30px rgba(15,23,42,.06)}.student-settings-card-head{display:flex;align-items:flex-start;gap:.85rem;margin-bottom:1.05rem}.student-settings-card-head>span{display:grid;place-items:center;flex:0 0 32px;width:32px;height:32px;border-radius:10px;background:linear-gradient(145deg,#7061e8,#5545cf);color:#fff;font-size:.78rem;font-weight:900;box-shadow:0 7px 18px rgba(99,102,241,.25)}.student-settings-card-head h2{margin:0;color:var(--settings-copy);font-size:1rem}.student-settings-card-head p{margin:.2rem 0 0;color:var(--settings-muted);font-size:.7rem;line-height:1.5}
.student-settings-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.85rem}.student-settings-fields.two-columns{grid-template-columns:repeat(2,minmax(0,1fr))}.student-settings-fields label>span{display:block;margin-bottom:.38rem;color:var(--settings-copy);font-size:.72rem;font-weight:800}.student-settings-fields input,.student-settings-fields select{width:100%;height:44px;padding:0 .8rem;border:1px solid var(--settings-border);border-radius:11px;outline:0;background:var(--settings-soft);color:var(--settings-copy);font:inherit;font-size:.78rem;transition:border-color .16s ease,box-shadow .16s ease}.student-settings-fields input:focus,.student-settings-fields select:focus{border-color:#8172ef;box-shadow:0 0 0 3px rgba(129,114,239,.14)}.student-settings-fields label>small{display:block;margin-top:.32rem;color:var(--settings-muted);font-size:.61rem}.student-settings-input-suffix{position:relative}.student-settings-input-suffix input{padding-right:3.5rem}.student-settings-input-suffix em{position:absolute;right:.8rem;top:50%;transform:translateY(-50%);color:var(--settings-muted);font-size:.66rem;font-style:normal;font-weight:800}
.student-settings-switch{display:flex;align-items:center;gap:.65rem;width:max-content;max-width:100%;margin-bottom:1rem;cursor:pointer}.student-settings-switch input{position:absolute;opacity:0;pointer-events:none}.student-settings-switch>span{position:relative;width:42px;height:24px;border-radius:999px;background:var(--settings-soft);border:1px solid var(--settings-border);transition:.18s ease}.student-settings-switch>span::after{content:'';position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:var(--settings-muted);transition:.18s ease}.student-settings-switch input:checked+span{border-color:#7465e7;background:rgba(99,102,241,.26)}.student-settings-switch input:checked+span::after{left:21px;background:#8b7cff}.student-settings-switch strong{color:var(--settings-copy);font-size:.74rem}.score-fields{transition:opacity .18s ease}.score-fields.is-disabled{opacity:.42}.student-score-total{display:flex;flex-direction:column;justify-content:center;min-height:74px;padding:.75rem 1rem;border:1px dashed rgba(129,114,239,.42);border-radius:12px;background:rgba(99,102,241,.07)}.student-score-total span,.student-score-total small{color:var(--settings-muted);font-size:.62rem}.student-score-total strong{margin:.16rem 0;color:var(--settings-copy);font-size:1.2rem}
.student-weekly-preview{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-top:1rem;padding:.75rem .9rem;border:1px solid rgba(45,212,191,.24);border-radius:12px;background:rgba(20,184,166,.07)}.student-weekly-preview span{color:var(--settings-muted);font-size:.67rem}.student-weekly-preview strong{color:#5eead4;font-size:.78rem}.light-theme .student-weekly-preview strong{color:#08766a}
.student-settings-impact{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1rem;align-items:center;padding:1.1rem 1.2rem;border:1px solid rgba(129,114,239,.35);border-radius:18px;background:linear-gradient(135deg,rgba(99,102,241,.12),rgba(20,184,166,.055)),var(--settings-surface);box-shadow:0 14px 34px rgba(15,23,42,.09)}.student-settings-impact strong{color:var(--settings-copy);font-size:.82rem}.student-settings-impact p{margin:.25rem 0 0;color:var(--settings-muted);font-size:.68rem;line-height:1.55}.student-settings-actions{display:flex;gap:.6rem}.student-settings-actions button{min-height:43px;padding:.6rem .95rem;border-radius:11px;font-size:.7rem;font-weight:850;cursor:pointer}.student-settings-actions button:disabled{opacity:.58;cursor:wait}.student-settings-secondary{border:1px solid var(--settings-border);background:var(--settings-soft);color:var(--settings-copy)}.student-settings-primary{border:1px solid transparent;background:linear-gradient(135deg,#6d5de7,#5142c7);color:#fff;box-shadow:0 9px 22px rgba(99,102,241,.24)}.student-settings-status{grid-column:1/-1;min-height:0;color:var(--settings-muted);font-size:.7rem;font-weight:750}.student-settings-status:not(:empty){min-height:20px}.student-settings-status.is-success{color:#2dd4bf}.light-theme .student-settings-status.is-success{color:#08766a}.student-settings-status.is-warning{color:#fbbf24}.light-theme .student-settings-status.is-warning{color:#9a5700}.student-settings-status.is-error{color:#fb7185}

/* Study plan */
.study-mode-toggle{display:flex;align-items:center;justify-content:flex-end;gap:.75rem;margin:0 0 1.35rem;padding:0;border:0;background:transparent}
.study-mode-toggle>span{color:var(--diag-muted);font-size:.7rem;font-weight:800}
.study-mode-toggle>div{display:flex;gap:.2rem;padding:.25rem;border:1px solid var(--diag-border);border-radius:12px;background:var(--diag-soft)}
.study-mode-toggle button{display:block;min-height:40px;padding:.5rem .8rem;border-radius:9px;text-align:center}
.study-mode-toggle button small{display:none}.study-mode-toggle button strong{font-size:.75rem}
.study-plan-next-card{display:grid;grid-template-columns:74px minmax(0,1fr) auto;gap:1rem;align-items:center;padding:1.3rem 1.4rem;border-color:rgba(139,124,255,.38);border-radius:20px;background:linear-gradient(135deg,rgba(99,102,241,.13),rgba(20,184,166,.055)),var(--diag-surface);box-shadow:0 14px 34px rgba(15,23,42,.09);animation:study-content-enter .2s .04s cubic-bezier(.2,.8,.2,1) both}
.study-next-order{display:grid;place-items:center;width:66px;height:66px;border-radius:18px;background:linear-gradient(145deg,#6d5de7,#4f46c8);color:#fff;font-size:1.8rem;font-weight:900;box-shadow:0 10px 24px rgba(99,102,241,.25)}
.study-next-copy{min-width:0}.study-next-copy>span{color:#7869ec!important;font-size:.72rem!important;font-weight:850}.light-theme .study-next-copy>span{color:#5544cf!important}.study-next-copy h2{margin:.25rem 0;font-size:clamp(1.15rem,2.4vw,1.55rem);overflow-wrap:anywhere}.study-next-copy p{margin:0!important}.study-next-copy small{display:block;max-width:720px;margin-top:.45rem;color:var(--diag-muted);font-size:.72rem;line-height:1.5}
.study-progress-band{display:grid;grid-template-columns:auto minmax(220px,1fr) auto auto auto;gap:1rem;align-items:center;margin:1rem 0 1.5rem;padding:.9rem 1.1rem;border:1px solid var(--diag-border);border-radius:16px;background:var(--diag-surface);animation:study-content-enter .2s .08s cubic-bezier(.2,.8,.2,1) both}
.study-progress-band>div:not(.study-progress-visual){display:flex;flex-direction:column;gap:.12rem;white-space:nowrap}.study-progress-band span{color:var(--diag-muted);font-size:.66rem}.study-progress-band strong{color:var(--diag-copy);font-size:.85rem}
.study-progress-visual{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.65rem;align-items:center}.study-progress-visual>div{height:8px;border-radius:999px;background:var(--diag-soft);overflow:hidden}.study-progress-visual span{background:linear-gradient(90deg,#6554df,#2dd4bf)}
.study-plan-selector{margin-bottom:1.1rem}.study-plan-selector .diag-section-title{margin-bottom:.65rem}.study-plan-selector h2{font-size:1rem}
.study-plan-selector .diag-plan-tabs{margin:0}.study-plan-selector .diag-plan-tabs button{min-width:0;padding:.75rem 1rem}.study-plan-selector .diag-plan-tabs button>span{display:flex;align-items:center;justify-content:center;gap:.45rem}.study-plan-selector .diag-plan-tabs em{padding:.12rem .42rem;border-radius:999px;background:rgba(255,255,255,.2);font-size:.58rem;font-style:normal}.study-plan-selector .diag-plan-tabs button:not(.active) em{background:rgba(99,102,241,.12);color:#7869ec}.light-theme .study-plan-selector .diag-plan-tabs button:not(.active) em{color:#5544cf}
.study-plan-view-tabs{width:min(520px,100%);margin:1rem 0;padding:.25rem}.study-plan-view-tabs button{min-width:0!important}
.study-view-transition{animation:study-content-enter .2s cubic-bezier(.2,.8,.2,1) both}
.study-week-list{display:grid;gap:1rem}.study-week-group{border:1px solid var(--diag-border);border-radius:17px;background:var(--diag-surface);overflow:hidden}.study-week-group>header{display:flex;align-items:center;justify-content:space-between;padding:.85rem 1rem;background:var(--diag-soft)}.study-week-group>header>div{display:flex;align-items:baseline;gap:.35rem}.study-week-group>header span,.study-week-group>header small{color:var(--diag-muted);font-size:.68rem}.study-week-group>header strong{color:var(--diag-copy);font-size:1rem}
.study-week-row{display:grid;grid-template-columns:34px minmax(0,1fr) minmax(135px,.35fr) auto;gap:.8rem;align-items:center;padding:.85rem 1rem;border-top:1px solid var(--diag-border);transition:background .18s ease,border-color .18s ease,transform .18s ease}.study-week-row:hover{background:var(--diag-soft)}.study-week-row.completed{background:rgba(20,184,166,.035)}.study-week-row.in_progress{background:rgba(245,158,11,.045)}.study-week-row.late{border-left:3px solid #f59e0b}
.study-week-order{display:grid;place-items:center;width:30px;height:30px;border:1px solid var(--diag-border);border-radius:50%;color:var(--diag-muted);font-size:.72rem;font-weight:850}.study-week-row.completed .study-week-order{border-color:rgba(20,184,166,.4);background:rgba(20,184,166,.12);color:#5eead4}.light-theme .study-week-row.completed .study-week-order{color:#08766a}.study-week-row.in_progress .study-week-order{border-color:rgba(245,158,11,.4);background:rgba(245,158,11,.12);color:#fbbf24}.light-theme .study-week-row.in_progress .study-week-order{color:#8a4b00}
.study-week-lesson{min-width:0}.study-week-lesson strong,.study-week-lesson small{display:block}.study-week-lesson strong{color:var(--diag-copy);font-size:.8rem;overflow-wrap:anywhere}.study-week-lesson small{margin-top:.2rem;color:var(--diag-muted);font-size:.66rem}
.study-week-state{display:flex;flex-direction:column;align-items:flex-start;gap:.25rem}.study-week-state small{color:var(--diag-muted);font-size:.62rem}
.study-plan-sticky-action{margin-top:1.4rem}
.study-freestyle-state{animation:study-content-enter .22s cubic-bezier(.2,.8,.2,1) both}
.study-lesson-card details>p,.diag-full-detail>div{animation:study-detail-open .2s cubic-bezier(.2,.8,.2,1) both}.study-lesson-card summary,.diag-full-detail summary{display:flex;align-items:center;justify-content:space-between;gap:.5rem;list-style:none}.study-lesson-card summary::-webkit-details-marker,.diag-full-detail summary::-webkit-details-marker{display:none}.study-lesson-card summary::after,.diag-full-detail summary::after{content:'›';display:inline-block;transition:transform .18s ease}.study-lesson-card details[open] summary::after,.diag-full-detail[open] summary::after{transform:rotate(90deg)}

@keyframes study-page-enter{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes study-content-enter{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes study-progress-grow{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes study-detail-open{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}

@media(max-width:980px){
  .student-settings-overview{grid-template-columns:repeat(2,minmax(0,1fr))}.student-settings-impact{grid-template-columns:1fr}.student-settings-actions{justify-content:flex-start}
  .diag-focus-grid{grid-template-columns:1fr}
  .diag-foundation-card{grid-template-columns:minmax(0,1.5fr) minmax(130px,.45fr)}
  .study-progress-band{grid-template-columns:auto minmax(180px,1fr) auto auto}.study-progress-band>div:last-child{display:none}
  .study-week-row{grid-template-columns:32px minmax(0,1fr) auto}.study-week-state{grid-column:2}.study-week-row>.study-plan-table-action,.study-week-row>.study-unavailable{grid-column:3;grid-row:1/3}
}
@media(max-width:700px){
  .student-plan-settings{padding:.9rem .75rem 5.5rem}.student-settings-hero{align-items:stretch;flex-direction:column}.student-settings-back{align-self:flex-start}.student-settings-overview{grid-template-columns:1fr 1fr}.student-settings-fields,.student-settings-fields.two-columns{grid-template-columns:1fr}.student-settings-card{padding:1rem}.student-settings-actions{display:grid;grid-template-columns:1fr;width:100%}.student-settings-actions button{width:100%}.student-weekly-preview{align-items:flex-start;flex-direction:column;gap:.25rem}
  .study-module-page{padding:.85rem .75rem 6.5rem;overflow-x:hidden}
  .study-module-tabs{display:grid;grid-template-columns:1fr 1fr;width:100%;margin-bottom:1rem}.study-module-tabs button{width:100%;padding:.55rem .35rem;font-size:.76rem}
  .study-module-header{align-items:stretch;flex-direction:column}.study-module-header>.diag-btn{width:auto;align-self:flex-start}.study-module-header-actions{display:grid;grid-template-columns:minmax(0,1fr) auto;width:100%}.study-module-header-actions .study-plan-settings-button{width:100%}
  .study-module-header h1{font-size:1.85rem}.study-module-header p{font-size:.78rem}
  .diag-foundation-card{grid-template-columns:1fr 1fr}.diag-foundation-main{grid-column:1/-1;padding:1.1rem}.diag-foundation-metric{min-height:105px;border-top:1px solid var(--diag-border)}.diag-foundation-metric:nth-child(2){border-left:0}
  .diag-result-note{margin-bottom:1.2rem}.diag-result-note strong,.diag-result-note span{font-size:.7rem}
  .diag-focus-grid .diag-skill-card p{min-height:0}
  .diag-insight-columns{grid-template-columns:1fr}.diag-insight-columns .diag-card{padding:1rem}
  .diag-start-lesson-list li{grid-template-columns:32px minmax(0,1fr);padding:.85rem}.diag-start-lesson-list li>span{width:30px;height:30px}.diag-start-lesson-list p{display:none}
  .diag-result-actions{align-items:stretch;flex-direction:column}.diag-result-actions>.diag-btn{width:100%;min-width:0}.diag-full-detail{width:100%}
  .study-mode-toggle{align-items:stretch;flex-direction:column;margin:0 0 1rem}.study-mode-toggle>div{display:grid;grid-template-columns:1fr 1fr}.study-mode-toggle button{width:100%;min-height:44px}
  .study-plan-next-card{grid-template-columns:52px minmax(0,1fr);padding:1rem}.study-next-order{width:48px;height:48px;border-radius:14px;font-size:1.3rem}.study-plan-next-card>.diag-btn,.study-plan-next-card>.study-unavailable{grid-column:1/-1;width:100%}.study-next-copy small{display:none}
  .study-progress-band{grid-template-columns:1fr 1fr;gap:.8rem;padding:.85rem}.study-progress-visual{grid-column:1/-1;grid-row:2}.study-progress-band>div:nth-last-child(-n+2){display:flex}.study-progress-band>div:last-child{display:none}
  .study-plan-selector .diag-section-title{margin-bottom:.55rem}.study-plan-selector .diag-plan-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}.study-plan-selector .diag-plan-tabs button{padding:.65rem .3rem;font-size:.7rem}.study-plan-selector .diag-plan-tabs em{display:none}
  .study-plan-view-tabs{display:grid;grid-template-columns:1fr 1fr;overflow:visible}.study-plan-view-tabs button{width:100%;font-size:.73rem}
  .study-week-group>header{padding:.75rem .85rem}.study-week-row{grid-template-columns:30px minmax(0,1fr);gap:.65rem;padding:.85rem}.study-week-state{grid-column:2}.study-week-row>.study-plan-table-action,.study-week-row>.study-unavailable{grid-column:1/-1;grid-row:auto;width:100%;min-height:44px;text-align:center}.study-week-order{width:28px;height:28px}
  .study-plan-sticky-action{position:sticky;z-index:30;bottom:.55rem;margin:1.2rem -.15rem 0;padding:.7rem;border-color:rgba(139,124,255,.38);box-shadow:0 14px 36px rgba(15,23,42,.22);backdrop-filter:blur(14px)}.study-plan-sticky-action>div:first-child{display:none}.study-plan-sticky-action .diag-action-buttons,.study-plan-sticky-action .diag-btn{width:100%}
}
@media(max-width:380px){
  .study-module-page{padding-inline:.6rem}.study-module-tabs button{font-size:.7rem}.diag-foundation-card{grid-template-columns:1fr}.diag-foundation-main{grid-column:auto}.diag-foundation-metric{border-left:0}.diag-foundation-metric:nth-child(2){border-top:1px solid var(--diag-border)}
  .study-plan-selector .diag-plan-tabs{grid-template-columns:1fr}.study-plan-selector .diag-plan-tabs button{font-size:.76rem}
}
@media(prefers-reduced-motion:reduce){
  .study-module-page,.study-view-transition,.study-plan-next-card,.study-progress-band,.study-freestyle-state,.diag-result-progress>span,.diag-progress>span,.study-progress-visual span{animation:none!important;transition-duration:.01ms!important;transform:none!important}
}

.student-settings-date-options{display:flex;flex-wrap:wrap;gap:.55rem;margin-bottom:.8rem}
.student-settings-radio{display:flex;align-items:center;gap:.5rem;min-height:40px;padding:.55rem .75rem;border:1px solid var(--settings-border);border-radius:11px;background:var(--settings-soft);color:var(--settings-copy);font-size:.72rem;font-weight:800;cursor:pointer;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}
.student-settings-radio:has(input:checked){border-color:#8172ef;background:rgba(99,102,241,.12);box-shadow:0 0 0 3px rgba(129,114,239,.1)}
.student-settings-radio input{accent-color:#6d5de7;margin:0}
.student-settings-date-field{max-width:520px;margin-bottom:.25rem;transition:opacity .18s ease,transform .18s ease}
.student-settings-date-field.is-disabled{opacity:.52}
.student-settings-date-field input:disabled{cursor:not-allowed}
@media(max-width:700px){.student-settings-date-options{display:grid;grid-template-columns:1fr}.student-settings-date-field{max-width:none}}

.student-score-history-toolbar{display:flex;align-items:center;justify-content:space-between;gap:.8rem;margin-bottom:.75rem}.student-score-history-toolbar strong,.student-score-history-toolbar small{display:block}.student-score-history-toolbar strong{color:var(--settings-copy);font-size:.75rem}.student-score-history-toolbar small{margin-top:.18rem;color:var(--settings-muted);font-size:.62rem}.student-settings-add-score{min-height:36px;padding:.45rem .7rem;border:1px solid rgba(129,114,239,.45);border-radius:10px;background:rgba(99,102,241,.1);color:#7568e8;font-size:.68rem;font-weight:850;white-space:nowrap;cursor:pointer}.student-settings-add-score:disabled{opacity:.45;cursor:not-allowed}.student-score-history-list{display:grid;gap:.7rem}.student-score-history-entry{padding:.8rem;border:1px solid var(--settings-border);border-radius:14px;background:var(--settings-soft)}.student-score-history-entry-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.65rem}.student-score-history-entry-head strong,.student-score-history-entry-head small{display:block}.student-score-history-entry-head strong{color:var(--settings-copy);font-size:.72rem}.student-score-history-entry-head small{margin-top:.15rem;color:var(--settings-muted);font-size:.61rem}.student-score-history-remove{min-height:30px;padding:.35rem .6rem;border:1px solid rgba(244,63,94,.3);border-radius:8px;background:rgba(244,63,94,.08);color:#e11d48;font-size:.64rem;font-weight:800;cursor:pointer}.student-score-history-remove:disabled{opacity:.45;cursor:not-allowed}.student-score-history-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.65rem}.student-score-history-fields label>span{display:block;margin-bottom:.32rem;color:var(--settings-copy);font-size:.66rem;font-weight:800}.student-score-history-fields input{width:100%;height:40px;padding:0 .65rem;border:1px solid var(--settings-border);border-radius:9px;outline:0;background:var(--settings-surface);color:var(--settings-copy);font:inherit;font-size:.74rem}.student-score-history-fields input:focus{border-color:#8172ef;box-shadow:0 0 0 3px rgba(129,114,239,.14)}.student-score-history-fields label>small{display:block;margin-top:.25rem;color:var(--settings-muted);font-size:.57rem}.student-score-history-fields .student-score-total{min-height:40px;padding:.55rem .7rem}.student-score-history-fields .student-score-total strong{font-size:1rem}.student-score-history-empty{padding:.8rem;border:1px dashed var(--settings-border);border-radius:11px;color:var(--settings-muted);font-size:.68rem;text-align:center}.student-settings-score-history.is-disabled .student-score-history-list{opacity:.72}
@media(max-width:700px){.student-score-history-toolbar{align-items:flex-start;flex-direction:column}.student-settings-add-score{width:100%}.student-score-history-fields{grid-template-columns:1fr 1fr}.student-score-history-fields label:first-child{grid-column:1/-1}.student-score-history-fields .student-score-total{grid-column:1/-1}}

/* Refined study-duration and exam-date controls */
.student-settings-date-field>label{display:block;padding:1rem 1.05rem;border:1px solid var(--settings-border);border-radius:14px;background:linear-gradient(135deg,rgba(99,102,241,.07),rgba(20,184,166,.045)),var(--settings-soft)}
.student-settings-date-field label>span{display:block;margin-bottom:.5rem;color:var(--settings-copy);font-size:.72rem;font-weight:850}
.student-settings-date-control{display:flex;align-items:center;gap:.55rem;width:min(100%,300px);min-height:46px;padding:0 .75rem;border:1px solid var(--settings-border);border-radius:11px;background:var(--settings-surface);box-shadow:0 5px 16px rgba(15,23,42,.05);transition:border-color .16s ease,box-shadow .16s ease}
.student-settings-date-control:focus-within{border-color:#8172ef;box-shadow:0 0 0 3px rgba(129,114,239,.14)}
.student-settings-date-control>span{flex:0 0 auto;margin:0;color:#7568e8;font-size:.9rem}
.student-settings-date-control input{width:100%;min-width:0;height:42px;padding:0;border:0;outline:0;background:transparent;color:var(--settings-copy);font:inherit;font-size:.78rem;font-weight:750}
.student-settings-date-field label>small{display:block;margin-top:.5rem;color:var(--settings-muted);font-size:.62rem;line-height:1.5}
.student-settings-date-field.is-disabled .student-settings-date-control{background:var(--settings-soft);box-shadow:none}
.student-settings-duration-label{min-width:0}
.student-settings-duration-inputs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem}
.student-settings-duration-inputs .student-settings-input-suffix input{height:46px;background:var(--settings-surface);box-shadow:0 5px 16px rgba(15,23,42,.04)}
.student-settings-duration-inputs .student-settings-input-suffix input:focus{background:var(--settings-surface)}
.student-settings-duration-label>small{display:flex;align-items:baseline;gap:.25rem;margin-top:.5rem;color:var(--settings-muted);font-size:.62rem}
.student-settings-duration-label>small strong{color:#0f9f91;font-size:.7rem}
.light-theme .student-settings-duration-label>small strong{color:#08766a}
@media(max-width:700px){.student-settings-date-control{width:100%}.student-settings-duration-inputs{gap:.55rem}}

/* ==========================================================================
   STUDENT EXAM PAGES — MOBILE COMPLETENESS & CONTRAST POLISH
   ========================================================================== */
.exam-group-details-page,
.exam-lobby-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.exam-group-details-page *,
.exam-lobby-page * {
  box-sizing: border-box;
}

.exam-group-topbar,
.exam-group-summary,
.exam-group-selection-bar,
.exam-lobby-page,
.exam-lobby-shell,
.exam-lobby-content {
  min-width: 0;
}

.exam-group-breadcrumbs {
  min-width: 0;
  flex-wrap: wrap;
}

.exam-group-breadcrumb-nav {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}

.exam-group-breadcrumb-nav > span {
  overflow-wrap: anywhere;
}

.exam-group-selection-copy {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.exam-group-selection-copy > div:nth-child(2) {
  flex: 0 1 auto;
  min-width: 0;
}

.exam-group-select-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #c4b5fd;
  border-radius: 10px;
  background: #f5f3ff;
  color: #6d28d9;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.exam-group-select-all-btn .material-symbols-outlined {
  font-size: 1rem;
}

.exam-group-select-all-btn:hover {
  background: #ede9fe;
  border-color: #a78bfa;
}

.exam-group-select-all-btn.is-selected {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #ffffff;
}

.exam-group-select-all-btn.is-selected:hover {
  background: #6d28d9;
  border-color: #6d28d9;
}

.exam-group-table-scroll {
  min-width: 0;
  width: 100%;
}

.exam-group-parts-table {
  width: 100%;
}

.exam-lobby-page {
  color: var(--text-primary);
}

.exam-lobby-hero {
  background-position: center;
  background-size: cover;
}

.exam-lobby-hero-overlay {
  pointer-events: none;
}

.exam-lobby-hero-copy h1 {
  max-width: 100%;
  color: #ffffff !important;
  line-height: 1.18 !important;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.88) !important;
}

.exam-lobby-hero-copy > span {
  color: #ffffff !important;
  background: rgba(49, 46, 129, 0.86) !important;
  border-color: rgba(196, 181, 253, 0.7) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.28);
}

.exam-lobby-description p {
  color: #475569 !important;
}

body.dark-theme .exam-lobby-description p {
  color: #cbd5e1 !important;
}

.exam-lobby-stat-card > span:first-child {
  color: #64748b !important;
}

body.dark-theme .exam-lobby-stat-card > span:first-child {
  color: #aeb8cc !important;
}

.exam-lobby-guidelines h3 {
  color: #5146b6 !important;
}

body.dark-theme .exam-lobby-guidelines h3 {
  color: #c4b5fd !important;
}

.exam-lobby-guidelines,
.exam-lobby-guidelines li {
  color: #475569;
}

body.dark-theme .exam-lobby-guidelines,
body.dark-theme .exam-lobby-guidelines li {
  color: #cbd5e1;
}

@media (max-width: 700px) {
  .exam-group-details-page {
    gap: 1rem !important;
  }

  .exam-group-topbar {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .exam-group-topbar > * {
    width: 100% !important;
    min-width: 0 !important;
  }

  .exam-group-breadcrumbs {
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.35rem 0.55rem !important;
    line-height: 1.2;
  }

  .exam-group-breadcrumbs button {
    flex: 0 0 auto !important;
    min-height: 44px !important;
    white-space: nowrap;
  }

  .exam-group-breadcrumb-nav {
    flex: 1 1 210px;
    gap: 0.35rem 0.55rem !important;
  }

  .exam-group-breadcrumb-nav > span {
    max-width: 100%;
    font-size: 0.72rem !important;
  }

  .exam-group-summary {
    align-items: stretch !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 0.9rem !important;
    margin-top: 0 !important;
  }

  .exam-group-summary > div {
    width: auto !important;
    min-width: 0 !important;
  }

  .exam-group-summary h1 {
    font-size: 1.45rem !important;
    line-height: 1.22 !important;
    overflow-wrap: anywhere;
  }

  .exam-group-summary p {
    font-size: 0.78rem !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere;
  }

  .exam-group-summary > div:last-child {
    align-self: flex-start;
    width: auto !important;
    min-width: 112px !important;
    max-width: 128px;
    justify-self: end;
  }

  .exam-group-selection-bar {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 0.9rem !important;
    padding: 1rem !important;
    margin-top: 0.25rem !important;
  }

  .exam-group-selection-copy {
    align-items: flex-start !important;
    width: 100%;
    justify-content: flex-start !important;
    gap: 0.7rem !important;
    flex-wrap: wrap !important;
  }

  .exam-group-selection-copy-main {
    flex: 1 1 100% !important;
  }

  .exam-group-selection-filters {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .exam-group-selection-filters > button {
    width: auto;
    min-width: max-content;
    flex: 0 0 auto;
    min-height: 42px;
    padding-inline: 0.4rem !important;
    font-size: 0.68rem !important;
    white-space: nowrap;
  }

  .exam-group-selection-filters > button .material-symbols-outlined {
    font-size: 1rem;
  }

  .exam-group-select-all-btn {
    min-height: 42px !important;
    padding: 0.55rem 0.7rem !important;
    font-size: 0.72rem !important;
  }

  .exam-group-selection-copy > div:last-child {
    min-width: 0;
  }

  .exam-group-selection-copy span {
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .exam-group-selection-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem !important;
    width: 100%;
  }

  .exam-group-selection-actions button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 0.6rem 0.45rem !important;
    font-size: 0.72rem !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .exam-group-set-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    padding-top: 0.25rem !important;
  }

  .exam-group-set-grid .test-set-card {
    padding: 1rem !important;
  }

  .exam-group-table-scroll {
    overflow: visible !important;
    border-radius: 18px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .exam-group-parts-table {
    display: block !important;
    min-width: 0 !important;
  }

  .exam-group-parts-table thead {
    display: none !important;
  }

  .exam-group-parts-table tbody {
    display: grid !important;
    gap: 0.7rem;
    padding: 0.05rem;
  }

  .exam-group-parts-table tr.exam-group-part-row {
    display: grid !important;
    grid-template-columns: 2.1rem minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.3rem 0.65rem;
    padding: 0.68rem 0.75rem !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 13px;
    background: #ffffff;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.05);
  }

  .exam-group-parts-table tr.exam-group-part-row[style*="display: none"] {
    display: none !important;
  }

  body.dark-theme .exam-group-parts-table tr.exam-group-part-row {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(30, 41, 59, 0.72);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  }

  .exam-group-parts-table td {
    display: block !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow-wrap: anywhere;
  }

  .exam-group-parts-table td:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / span 3;
    padding-top: 0.15rem !important;
  }

  .exam-group-parts-table td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    color: #334155 !important;
    font-size: 0.9rem !important;
  }

  body.dark-theme .exam-group-parts-table td:nth-child(2) {
    color: #e2e8f0 !important;
  }

  .exam-group-parts-table td:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    padding-top: 0.15rem !important;
    color: var(--text-primary) !important;
    font-size: 0.82rem !important;
    line-height: 1.4;
  }

  .exam-group-parts-table td:nth-child(3)::before,
  .exam-group-parts-table td:nth-child(4)::before,
  .exam-group-parts-table td:nth-child(5)::before,
  .exam-group-parts-table td:nth-child(6)::before {
    display: block;
    margin-bottom: 0.18rem;
    color: #64748b;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  body.dark-theme .exam-group-parts-table td:nth-child(3)::before,
  body.dark-theme .exam-group-parts-table td:nth-child(4)::before,
  body.dark-theme .exam-group-parts-table td:nth-child(5)::before,
  body.dark-theme .exam-group-parts-table td:nth-child(6)::before {
    color: #aeb8cc;
  }

  .exam-group-parts-table td:nth-child(3)::before { content: 'จำนวนครั้งที่ทำเสร็จ'; }
  .exam-group-parts-table td:nth-child(4)::before { content: 'ความยาก'; }
  .exam-group-parts-table td:nth-child(5)::before { content: 'จำนวนคำถาม'; }
  .exam-group-parts-table td:nth-child(6)::before { content: 'สถานะ'; }

  .exam-group-parts-table td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .exam-group-parts-table td:nth-child(4) { grid-column: 3; grid-row: 1; }
  .exam-group-parts-table td:nth-child(5) { grid-column: 3; grid-row: 2; }
  .exam-group-parts-table td:nth-child(6) { grid-column: 2 / -1; grid-row: 3; }

  .exam-group-parts-table td:nth-child(4),
  .exam-group-parts-table td:nth-child(5) {
    align-self: start;
  }

  .exam-group-parts-table td:nth-child(6) > div {
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    gap: 0.35rem !important;
    width: 100% !important;
    max-width: none !important;
  }

  .exam-group-parts-table td:nth-child(6) span {
    white-space: normal !important;
    overflow-wrap: anywhere;
    font-size: 0.62rem !important;
  }

  .exam-group-parts-table td input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
  }

  .exam-lobby-page {
    margin: 0.25rem auto 0 !important;
    gap: 1rem !important;
  }

  .exam-lobby-back-row {
    padding: 0 0.1rem;
  }

  .exam-lobby-back-row button {
    min-height: 44px !important;
    padding: 0.55rem 0.9rem !important;
  }

  .exam-lobby-shell {
    border-radius: 18px !important;
  }

  .exam-lobby-hero {
    height: 150px !important;
    padding: 1.2rem !important;
    background-position: center !important;
  }

  .exam-lobby-hero-overlay {
    background: linear-gradient(115deg, rgba(5, 8, 20, 0.94) 0%, rgba(15, 23, 42, 0.82) 58%, rgba(15, 23, 42, 0.52) 100%) !important;
  }

  .exam-lobby-hero-copy h1 {
    font-size: 1.28rem !important;
    line-height: 1.2 !important;
  }

  .exam-lobby-hero-copy > span {
    font-size: 0.65rem !important;
    padding: 0.25rem 0.45rem !important;
  }

  .exam-lobby-content {
    gap: 1.15rem !important;
    padding: 1.15rem !important;
    margin-top: 0 !important;
  }

  .exam-lobby-description p {
    font-size: 0.86rem !important;
    line-height: 1.7 !important;
  }

  .exam-lobby-stats {
    grid-template-columns: 1fr !important;
    gap: 0.7rem !important;
  }

  .exam-lobby-stat-card {
    min-width: 0 !important;
    padding: 0.9rem !important;
  }

  .exam-lobby-stat-card > span {
    overflow-wrap: anywhere;
  }

  .exam-lobby-breakdown {
    padding: 1rem !important;
  }

  .exam-lobby-breakdown-grid {
    grid-template-columns: 1fr !important;
    gap: 0.55rem !important;
  }

  .exam-lobby-breakdown-grid > div {
    min-width: 0 !important;
    gap: 0.5rem !important;
  }

  .exam-lobby-breakdown-grid > div span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .exam-lobby-guidelines {
    padding: 1rem !important;
  }

  .exam-lobby-guidelines h3 {
    font-size: 0.92rem !important;
    line-height: 1.35 !important;
  }

  .exam-lobby-guidelines ul {
    padding-left: 1rem !important;
    font-size: 0.78rem !important;
    line-height: 1.6 !important;
  }

  .exam-lobby-mode-selector {
    padding: 1rem !important;
  }

  .exam-lobby-mode-selector > div {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.55rem !important;
  }

  .exam-lobby-mode-selector .lobby-mode-card {
    min-width: 0 !important;
    padding: 0.7rem 0.5rem !important;
  }

  .exam-lobby-mode-selector .lobby-mode-card span {
    overflow-wrap: anywhere;
  }

  .exam-lobby-timer-settings,
  .exam-lobby-listening-settings {
    padding: 1rem !important;
  }

  .exam-lobby-timer-settings > div:first-child {
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  .exam-lobby-listening-settings label {
    gap: 0.6rem !important;
  }

  .exam-lobby-listening-settings label span {
    overflow-wrap: anywhere;
  }

  .exam-lobby-actions {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
  }

  .exam-lobby-actions button {
    width: 100% !important;
    min-height: 48px !important;
    min-width: 0 !important;
    white-space: normal !important;
  }
}

@media (max-width: 380px) {
  .exam-group-selection-actions button {
    font-size: 0.68rem !important;
  }

  .exam-lobby-hero {
    height: 142px !important;
  }

  .exam-lobby-hero-copy h1 {
    font-size: 1.15rem !important;
  }

  .exam-lobby-mode-selector > div {
    grid-template-columns: 1fr !important;
  }
}

/* Additive roadmap cues: keep the existing diagnostic and study-plan layout intact. */
.diag-skill-card p.diag-skill-cause {
  margin-top: .45rem;
  min-height: 0;
  color: #c4b5fd;
  font-size: .69rem;
  line-height: 1.45;
}
.light-theme .diag-skill-card p.diag-skill-cause { color: #5544cf; }
.study-module-header .study-active-plan-badge {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: .45rem;
  padding: .22rem .55rem;
  border: 1px solid rgba(139,124,255,.28);
  border-radius: 999px;
  background: rgba(99,102,241,.08);
  color: #c4b5fd;
  font-size: .67rem;
  line-height: 1.45;
}
.study-module-header .study-active-plan-badge.active { border-color: rgba(45,212,191,.28); background: rgba(20,184,166,.08); color: #5eead4; }
.study-module-header .study-active-plan-badge.pending { color: #c4b5fd; }
.light-theme .study-module-header .study-active-plan-badge { color: #5544cf; background: #f4f1ff; border-color: #d8d1ff; }
.light-theme .study-module-header .study-active-plan-badge.active { color: #08766a; background: #effcf9; border-color: #b9eee5; }
.study-progress-checkpoint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -.65rem 0 1.5rem;
  padding: .7rem 1rem;
  border: 1px solid var(--diag-border);
  border-left: 3px solid #8b7cff;
  border-radius: 13px;
  background: linear-gradient(90deg, rgba(99,102,241,.08), transparent), var(--diag-surface);
}
.study-progress-checkpoint>div { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.study-progress-checkpoint span { color: var(--diag-muted); font-size: .65rem; }
.study-progress-checkpoint strong { color: var(--diag-copy); font-size: .76rem; overflow-wrap: anywhere; }
.study-progress-checkpoint p { margin: 0; color: var(--diag-muted); font-size: .67rem; line-height: 1.45; text-align: right; }
.study-progress-checkpoint.ready { border-left-color: #2dd4bf; background: linear-gradient(90deg, rgba(20,184,166,.09), transparent), var(--diag-surface); }
.study-progress-checkpoint.ready strong { color: #5eead4; }
.light-theme .study-progress-checkpoint.ready strong { color: #08766a; }
@media (max-width: 700px) {
  .study-progress-checkpoint { align-items: flex-start; flex-direction: column; gap: .3rem; }
  .study-progress-checkpoint p { text-align: left; }
  .study-module-header .study-active-plan-badge { width: 100%; border-radius: 10px; }
}

/* The exam-focus mobile rules above intentionally use strong selectors. Keep
   Part 2 in normal document flow even when that focus mode is active, so the
   audio card, tools, and answer panel cannot occupy the same grid row. */
@media (max-width: 900px) {
  body.exam-focus-mode .test-workspace.part-2-layout.mobile-focus-listening {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  body.exam-focus-mode .test-workspace.part-2-layout.mobile-focus-listening .workspace-left,
  body.exam-focus-mode .test-workspace.part-2-layout.mobile-focus-listening .workspace-right {
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
  }

  body.exam-focus-mode .test-workspace.part-2-layout.mobile-focus-listening .workspace-left > div:nth-child(2) {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.exam-focus-mode .test-workspace.part-2-layout.mobile-focus-listening .audio-player-card {
    position: static !important;
    margin-bottom: 0.25rem !important;
  }

  body.exam-focus-mode .test-workspace.part-2-layout.mobile-focus-listening .part2-study-tools {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    flex-direction: row !important;
    gap: 0.5rem !important;
    margin-top: 0.75rem !important;
  }

  body.exam-focus-mode .test-workspace.part-2-layout.mobile-focus-listening .part2-study-tools .btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 0.6rem 0.35rem !important;
    font-size: 0.72rem !important;
    line-height: 1.25 !important;
    white-space: normal !important;
  }

  body.exam-focus-mode .test-workspace.part-2-layout.mobile-focus-listening .vocab-display-panel {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 0.75rem 0 0 !important;
  }

  body.exam-focus-mode .test-workspace.part-2-layout.mobile-focus-listening .questions-scroll-area {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
}

/* ==========================================================================
   STUDENT TEST RUNNER — PART 2 / PART 3–4 / PART 6–7 FOLLOW-UP POLISH
   ========================================================================== */
.formatted-explanation-part5-only {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

.formatted-explanation-part5-only + .formatted-explanation-part5-only {
  margin-top: 0.55rem;
}

@media (max-width: 900px) {
  /* Part 2: keep the audio, study tools, and question pane in normal flow. */
  .test-workspace.part-2-layout {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    gap: 0.75rem !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 0.75rem !important;
  }

  .test-workspace.part-2-layout .workspace-left,
  .test-workspace.part-2-layout .workspace-right {
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
  }

  .test-workspace.part-2-layout .workspace-left > div:nth-child(2) {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .test-workspace.part-2-layout .audio-player-card {
    position: static !important;
    z-index: auto !important;
    margin-bottom: 0.25rem !important;
  }

  .test-workspace.part-2-layout .part2-study-tools {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    flex-direction: row !important;
    gap: 0.5rem !important;
    margin-top: 0.75rem !important;
  }

  .test-workspace.part-2-layout .part2-study-tools .btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 0.6rem 0.35rem !important;
    font-size: 0.72rem !important;
    line-height: 1.25 !important;
    white-space: normal !important;
  }

  .test-workspace.part-2-layout .vocab-display-panel {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 0.75rem 0 0 !important;
  }

  .test-workspace.part-2-layout .questions-scroll-area {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  /* Part 3–4: make the Practice helper block resilient and tappable. */
  .test-workspace.part-3-layout .part34-practice-tools,
  .test-workspace.part-4-layout .part34-practice-tools {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
  }

  .test-workspace.part-3-layout .part34-toggles-header,
  .test-workspace.part-4-layout .part34-toggles-header {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.45rem !important;
    margin-bottom: 0.75rem !important;
  }

  .test-workspace.part-3-layout .part34-toggle-btn,
  .test-workspace.part-4-layout .part34-toggle-btn {
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 0.55rem 0.35rem !important;
    font-size: 0.72rem !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere;
  }

  .test-workspace.part-3-layout .part34-section-block,
  .test-workspace.part-4-layout .part34-section-block,
  .test-workspace.part-3-layout .part34-vocab-container,
  .test-workspace.part-4-layout .part34-vocab-container {
    max-width: 100% !important;
    overflow-wrap: anywhere;
  }

  .test-workspace.part-3-layout .part34-vocab-container > div:last-child,
  .test-workspace.part-4-layout .part34-vocab-container > div:last-child {
    grid-template-columns: 1fr !important;
  }

  /* Part 6–7: article first, then every question in one continuous flow. */
  .test-workspace.reading-article-question-layout {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    gap: 0.75rem !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 0.75rem !important;
  }

  .test-workspace.reading-article-question-layout .workspace-resizer {
    display: none !important;
  }

  .test-workspace.reading-article-question-layout .reading-article-panel,
  .test-workspace.reading-article-question-layout .workspace-right {
    order: initial !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
  }

  .test-workspace.reading-article-question-layout .reading-article-panel {
    order: 1 !important;
  }

  .test-workspace.reading-article-question-layout .workspace-right {
    order: 2 !important;
  }

  .test-workspace.reading-article-question-layout .questions-scroll-area {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }

  .test-workspace.reading-article-question-layout .question-block {
    margin-bottom: 0.7rem !important;
  }
}

@media (max-width: 380px) {
  .test-workspace.part-2-layout .part2-study-tools {
    gap: 0.35rem !important;
  }

  .test-workspace.part-2-layout .part2-study-tools .btn,
  .test-workspace.part-3-layout .part34-toggle-btn,
  .test-workspace.part-4-layout .part34-toggle-btn {
    font-size: 0.66rem !important;
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
  }
}

/* ===========================================================================
   HEALTH CHECK ONBOARDING — DESIGN 1: START HERE + STEPPER
   Scoped to the new-user dashboard hero so the existing dashboard stays
   visually and behaviorally unchanged for returning students.
   =========================================================================== */
.health-check-onboarding-hero.mockup-hero-card {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  align-items: stretch;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: clamp(1.5rem, 3.5vw, 2.75rem) clamp(1.25rem, 4vw, 3rem) !important;
  overflow: hidden;
  background:
    radial-gradient(circle at 95% 8%, rgba(45, 212, 191, 0.3), transparent 34%),
    linear-gradient(135deg, rgba(16, 185, 129, 0.26), rgba(20, 184, 166, 0.15)),
    #062a26;
  animation: health-check-onboarding-card-enter 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.health-check-onboarding-hero.mockup-hero-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #6ee7b7, #2dd4bf);
  border-radius: 24px 0 0 24px;
  pointer-events: none;
}

body.light-theme .health-check-onboarding-hero.mockup-hero-card {
  background:
    radial-gradient(circle at 95% 8%, rgba(45, 212, 191, 0.3), transparent 34%),
    linear-gradient(135deg, #063d35 0%, #0b4038 58%, #064e45 100%);
  border-color: rgba(110, 231, 183, 0.32) !important;
  box-shadow: 0 14px 34px rgba(6, 78, 69, 0.32) !important;
}

.health-check-onboarding-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.health-check-onboarding-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  color: #6ee7b7;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

body.dark-theme .health-check-onboarding-eyebrow {
  color: #a7f3d0;
}

.health-check-onboarding-eyebrow-mark {
  display: inline-grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.55rem;
  color: #ffffff;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  box-shadow: 0 5px 12px rgba(20, 184, 166, 0.3);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.health-check-onboarding-title {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.7rem, 3.5vw, 2.65rem);
  font-weight: 950;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.health-check-onboarding-title span {
  color: #6ee7b7;
}

body.dark-theme .health-check-onboarding-title span {
  color: #a7f3d0;
}

.health-check-onboarding-description {
  max-width: 690px;
  margin: 0.9rem 0 0;
  color: var(--text-secondary);
  font-size: clamp(0.9rem, 1.6vw, 1.02rem);
  line-height: 1.65;
}

.health-check-onboarding-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
  color: #a7f3d0;
  font-size: 0.84rem;
  font-weight: 850;
}

body.dark-theme .health-check-onboarding-meta {
  color: #a7f3d0;
}

.health-check-onboarding-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.health-check-onboarding-meta-divider {
  color: var(--text-muted);
  font-size: 1rem;
}

.health-check-onboarding-steps {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 610px;
  margin: 1.35rem 0 1.5rem;
  padding: 0;
  list-style: none;
}

.health-check-onboarding-step {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.health-check-onboarding-step.is-active {
  color: var(--text-primary);
}

.health-check-onboarding-step-number {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 50%;
  background: var(--bg-card, #ffffff);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.health-check-onboarding-step.is-active .health-check-onboarding-step-number {
  border-color: #2dd4bf;
  background: linear-gradient(135deg, #2dd4bf, #0d9488);
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(20, 184, 166, 0.3);
}

.health-check-onboarding-step-connector {
  height: 1px;
  min-width: 1.4rem;
  flex: 1 1 3rem;
  margin: 0 0.7rem;
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.62), rgba(167, 243, 208, 0.34));
}

.health-check-onboarding-cta {
  width: min(100%, 460px);
  min-height: 54px;
  padding: 0.9rem 1.35rem;
  font-size: 1rem;
  border-radius: 15px !important;
  background: linear-gradient(135deg, #fb923c 0%, #f97316 55%, #ea580c 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 25px rgba(234, 88, 12, 0.42) !important;
}

.health-check-onboarding-cta:hover {
  box-shadow: 0 12px 30px rgba(234, 88, 12, 0.58) !important;
  filter: brightness(1.06);
}

.health-check-onboarding-cta:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.health-check-onboarding-cta-arrow {
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.health-check-onboarding-cta:hover .health-check-onboarding-cta-arrow {
  transform: translateX(3px);
}

.health-check-onboarding-note {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.health-check-onboarding-visual {
  position: relative;
  z-index: 1;
  min-height: 245px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(110, 231, 183, 0.28);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 34%, rgba(45, 212, 191, 0.3), transparent 48%),
    rgba(20, 184, 166, 0.11);
  text-align: center;
}

.health-check-onboarding-visual::before,
.health-check-onboarding-visual::after {
  content: '';
  position: absolute;
  border: 1px solid rgba(110, 231, 183, 0.22);
  border-radius: 50%;
  pointer-events: none;
  animation: health-check-onboarding-orbit-pulse 6s ease-in-out infinite;
}

.health-check-onboarding-visual::before {
  width: 340px;
  height: 340px;
}

.health-check-onboarding-visual::after {
  width: 260px;
  height: 260px;
}

body.light-theme .health-check-onboarding-visual {
  background:
    radial-gradient(circle at 50% 34%, rgba(45, 212, 191, 0.28), transparent 48%),
    rgba(20, 184, 166, 0.1);
  border-color: rgba(110, 231, 183, 0.24);
}

.health-check-onboarding-visual-pill {
  position: relative;
  z-index: 2;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(110, 231, 183, 0.26);
  border-radius: 999px;
  background: rgba(6, 61, 53, 0.72);
  color: #a7f3d0;
  font-size: 0.7rem;
  font-weight: 900;
}

body.dark-theme .health-check-onboarding-visual-pill {
  background: rgba(6, 42, 38, 0.78);
  color: #a7f3d0;
}

.health-check-onboarding-target-art {
  position: relative;
  z-index: 2;
  width: 142px;
  height: 142px;
  display: grid;
  place-items: center;
  animation: health-check-onboarding-target-float 5s ease-in-out infinite;
}

.health-check-onboarding-target-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(110, 231, 183, 0.38);
  box-sizing: border-box;
}

.health-check-onboarding-target-ring-outer {
  inset: 0;
  background: rgba(110, 231, 183, 0.08);
}

.health-check-onboarding-target-ring-middle {
  inset: 22px;
  background: rgba(110, 231, 183, 0.14);
}

.health-check-onboarding-target-ring-inner {
  inset: 44px;
  border-color: rgba(110, 231, 183, 0.56);
  background: rgba(45, 212, 191, 0.2);
}

.health-check-onboarding-target-center {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6ee7b7, #14b8a6);
  color: #063d35;
  box-shadow: 0 8px 18px rgba(20, 184, 166, 0.42);
  font-size: 1.15rem;
  animation: health-check-onboarding-target-pulse 3.2s ease-in-out infinite;
}

.health-check-onboarding-target-arrow {
  position: absolute;
  top: -0.4rem;
  right: -0.1rem;
  color: #a7f3d0;
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-12deg);
  animation: health-check-onboarding-arrow-nudge 3.8s ease-in-out infinite;
}

body.dark-theme .health-check-onboarding-target-arrow {
  color: #a7f3d0;
}

/* Keep the mint hero readable when the rest of the application is in light
   mode. The hero intentionally uses the dark teal surface from the approved
   mockup, so it needs its own high-contrast text tokens. */
body.light-theme .health-check-onboarding-hero .health-check-onboarding-title,
body.light-theme .health-check-onboarding-hero .health-check-onboarding-step.is-active,
body.light-theme .health-check-onboarding-hero .health-check-onboarding-visual-title {
  color: #f0fdf4 !important;
}

body.light-theme .health-check-onboarding-hero .health-check-onboarding-description,
body.light-theme .health-check-onboarding-hero .health-check-onboarding-note,
body.light-theme .health-check-onboarding-hero .health-check-onboarding-visual-caption {
  color: rgba(236, 253, 245, 0.82) !important;
}

body.light-theme .health-check-onboarding-hero .health-check-onboarding-step:not(.is-active),
body.light-theme .health-check-onboarding-hero .health-check-onboarding-step-number {
  color: #d1fae5 !important;
}

.health-check-onboarding-hero .health-check-onboarding-step-number {
  background: rgba(6, 42, 38, 0.62);
  border-color: rgba(167, 243, 208, 0.32);
}

@keyframes health-check-onboarding-card-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes health-check-onboarding-orbit-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.02);
  }
}

@keyframes health-check-onboarding-target-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes health-check-onboarding-target-pulse {
  0%,
  100% {
    box-shadow: 0 8px 18px rgba(20, 184, 166, 0.42);
  }
  50% {
    box-shadow: 0 10px 24px rgba(45, 212, 191, 0.62);
  }
}

@keyframes health-check-onboarding-arrow-nudge {
  0%,
  100% {
    transform: rotate(-12deg) translate(0, 0);
  }
  50% {
    transform: rotate(-12deg) translate(3px, -2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .health-check-onboarding-hero.mockup-hero-card,
  .health-check-onboarding-visual::before,
  .health-check-onboarding-visual::after,
  .health-check-onboarding-target-art,
  .health-check-onboarding-target-center,
  .health-check-onboarding-target-arrow {
    animation: none !important;
  }
}

.health-check-onboarding-visual-title {
  position: relative;
  z-index: 2;
  margin-top: 0.45rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 900;
}

.health-check-onboarding-visual-caption {
  position: relative;
  z-index: 2;
  margin-top: 0.2rem;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

@media (max-width: 860px) {
  .health-check-onboarding-hero.mockup-hero-card {
    grid-template-columns: minmax(0, 1fr) minmax(205px, 0.58fr);
    gap: 1.35rem;
    padding: 1.5rem 1.35rem !important;
  }

  .health-check-onboarding-step {
    font-size: 0.72rem;
  }

  .health-check-onboarding-step-connector {
    margin: 0 0.45rem;
  }
}

@media (max-width: 680px) {
  .health-check-onboarding-hero.mockup-hero-card {
    grid-template-columns: 1fr;
    gap: 1.35rem;
    padding: 1.5rem 1.15rem !important;
  }

  .health-check-onboarding-visual {
    min-height: 205px;
  }

  .health-check-onboarding-steps {
    max-width: none;
    margin-top: 1.15rem;
    margin-bottom: 1.25rem;
  }

  .health-check-onboarding-cta {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .health-check-onboarding-title {
    font-size: 1.75rem;
  }

  .health-check-onboarding-description {
    font-size: 0.86rem;
  }

  .health-check-onboarding-step {
    flex-direction: column;
    gap: 0.3rem;
    text-align: center;
    white-space: normal;
  }

  .health-check-onboarding-step-connector {
    margin: -0.95rem 0.35rem 0;
  }

  .health-check-onboarding-step-label {
    line-height: 1.2;
  }
}
.teacher-plan-foundation-policy{margin:1rem 0;padding:.85rem 1rem;border:1px solid rgba(45,212,191,.32);border-radius:12px;background:rgba(45,212,191,.08);color:inherit}.teacher-plan-foundation-policy strong{display:block;color:#5eead4;font-size:.78rem}.teacher-plan-foundation-policy p{margin:.35rem 0 0;color:#cbd5e1;font-size:.7rem;line-height:1.55}.teacher-plan-foundation-policy details{margin-top:.55rem}.teacher-plan-foundation-policy summary{color:#a9a0ff;font-size:.68rem;font-weight:800;cursor:pointer}.teacher-plan-foundation-policy ul{margin:.45rem 0 0;padding-left:1.2rem;color:#cbd5e1;font-size:.68rem;line-height:1.55}.light-theme .teacher-plan-foundation-policy{border-color:rgba(13,148,136,.28);background:rgba(20,184,166,.08)}.light-theme .teacher-plan-foundation-policy strong{color:#08766a}.light-theme .teacher-plan-foundation-policy p,.light-theme .teacher-plan-foundation-policy ul{color:#566279}.light-theme .teacher-plan-foundation-policy summary{color:#5544cf}
