/* 
   Accessible AI Learning Application - Design System
   Vanilla CSS with customized themes and accessibility aids
*/

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;600&family=Lora:wght@400;700&family=Lexend:wght@400;600&display=swap');

/* --- Theme Definitions & Design Tokens --- */
:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --bg-primary: #050505;
  --bg-secondary: rgba(18, 18, 18, 0.85);
  --bg-card: rgba(25, 25, 25, 0.65);
  --bg-accent: rgba(246, 211, 101, 0.05);
  --text-primary: #f8f8f8;
  --text-secondary: #a0a0a0;
  --accent-color: #f6d365;
  --accent-primary: var(--accent-color);
  --accent-secondary: #fda085;
  --accent-gradient: var(--accent-color);
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --bg-main: var(--bg-primary);
  --border-color: rgba(246, 211, 101, 0.1);
  --border-hover: rgba(246, 211, 101, 0.4);
  --shadow-main: 0 16px 40px -8px rgba(0, 0, 0, 0.8);
  --glass-blur: blur(20px) saturate(150%);
  --focus-outline: 3px solid #f6d365;
  --font-scale: 1;
  --font-base: 1rem;
  --font-md: 1.15rem;
  --font-lg: 1.5rem;
  --font-xl: 2.25rem;
}

/* Light Theme overrides */
.theme-light {
  --bg-primary: #faf8f4;
  --bg-secondary: rgba(255, 255, 255, 0.8);
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-accent: rgba(15, 92, 77, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --accent-color: #0f5c4d;
  --accent-primary: var(--accent-color);
  --accent-secondary: #d46528;
  --accent-gradient: var(--accent-color);
  --border-color: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(15, 92, 77, 0.4);
  --shadow-main: 0 8px 30px rgba(0, 0, 0, 0.06);
  --glass-blur: blur(8px);
  --focus-outline: 3px dashed #0f5c4d;
}

/* Ultra High Contrast Theme (For Visually Impaired) */
.theme-hc,
.theme-high-contrast {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: #000000;
  --bg-accent: rgba(255, 230, 0, 0.15);
  --text-primary: #ffffff;
  --text-secondary: #ffe600;
  --accent-color: #ffe600;
  --accent-primary: #ffe600;
  --accent-secondary: #00ffff;
  --border-color: #ffffff;
  --border-hover: #ffe600;
  --focus-outline: 3px solid #ffe600;
}


/* --- Base Styles & Reset --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-size: calc(var(--font-base) * var(--font-scale));
  line-height: 1.5;
}

h1, h2, h3, h4, .font-heading {
  font-family: var(--font-main);
  font-weight: 700;
}

/* Accessibility Focus Indicator (Keyboard Navigation) */
*:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 4px;
}

/* Skip to Content Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent-color);
  color: var(--bg-primary);
  padding: 8px 16px;
  z-index: 100;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}

/* Screen Reader Only text (Visually Hidden) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Layout Components --- */
header {
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  backdrop-filter: var(--glass-blur);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem 2rem;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.logo-badge {
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
  font-size: 1.25rem;
}



.logo-text {
  font-size: calc(1.4rem * var(--font-scale));
  font-weight: 700;
  letter-spacing: -0.025em;
  background: var(--accent-gradient);
  color: var(--text-primary);
  background: none;
}


/* --- Accessibility Control Bar --- */
.accessibility-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.control-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.4rem 0.8rem;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}


.control-label {
  font-size: calc(0.85rem * var(--font-scale));
  font-weight: 600;
  color: var(--text-secondary);
}


.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  border-radius: 50%;
  transition: all 0.2s ease;
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-color);
}


.theme-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: calc(0.85rem * var(--font-scale));
}
.theme-btn:hover {
  border-color: var(--accent-color);
  background: var(--bg-accent);
}



/* Slider Customisation */
.slider-input {
  -webkit-appearance: none;
  width: 100px;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  outline: none;
}
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
}


/* --- Main Layout Grid --- */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

#nav-toggle { display: none; }
@media (max-width: 1024px) {
  #btn-mobile-chat {
    display: none;
  }
  .chat-input-bar {
    padding: 0.75rem !important;
    gap: 0.5rem !important;
  }
  .chat-input {
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem;
  }
  .chat-input-bar .btn-primary {
    padding: 0.75rem !important;
    min-width: unset !important;
  }

  main {
    grid-template-columns: 1fr;
  }
}

/* --- Left Column: Interactive Lessons --- */
.dashboard-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.welcome-banner {
  background: var(--bg-accent);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}


.welcome-banner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(15, 92, 77,0.2) 0%, transparent 70%);
  z-index: 0;
}


.welcome-title {
  font-size: calc(var(--font-xl) * var(--font-scale));
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.welcome-subtitle {
  color: var(--text-secondary);
  font-size: calc(var(--font-md) * var(--font-scale));
  position: relative;
  z-index: 1;
}


/* Section Titles */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-title {
  font-size: calc(var(--font-lg) * var(--font-scale));
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Modules Grid */


.module-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-main);
  position: relative;
}
.module-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: var(--accent-gradient);
  transition: width 0.3s ease;
  border-radius: 0 0 0 16px;
}



.module-card:hover, .module-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--border-hover);
}
.module-card:hover::after, .module-card:focus-visible::after {
  width: 100%;
}


.module-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 1.5rem;
}


.module-meta {
  font-size: calc(0.8rem * var(--font-scale));
  font-weight: 600;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


.module-name {
  font-size: calc(1.2rem * var(--font-scale));
  font-weight: 700;
}

.module-desc {
  font-size: calc(0.95rem * var(--font-scale));
  color: var(--text-secondary);
  flex-grow: 1;
}


/* Active Lesson Area */
.lesson-container {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-main);
  display: none; /* Shown dynamically */
  flex-direction: column;
  gap: 1.5rem;
}


.lesson-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.back-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.back-btn:hover {
  background: var(--bg-accent);
  border-color: var(--accent-color);
}


.lesson-image-wrapper {
  position: relative;
  width: 100%;
  max-height: 380px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}


.lesson-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lesson-visual-descriptor {
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: 1rem;
  border-radius: 8px;
  margin-top: -0.5rem;
  font-size: calc(0.95rem * var(--font-scale));
  border-left: 4px solid var(--accent-secondary);
}


.lesson-content {
  font-size: calc(1.1rem * var(--font-scale));
  line-height: 1.6;
}

.narrator-control-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}


/* --- Right Column: AI Tutor Chat --- */
.tutor-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  height: calc(100vh - 120px);
  box-shadow: var(--shadow-main);
}

.tutor-header {
  background: var(--bg-card);
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  z-index: 5;
}

.tutor-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tutor-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 61, 52, 0.18);
  flex-shrink: 0;
}

.tutor-title {
  font-size: calc(1.05rem * var(--font-scale));
  font-weight: 700;
  color: var(--text-primary);
}

.antigravity-pill {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 7px;
  border-radius: 9999px;
  background: var(--accent-color);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(212, 101, 40, 0.4);
  display: inline-block;
}

.tutor-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.tutor-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tutor-header-actions button,
.tutor-header-actions #btn-close-tutor {
  position: static !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
}

.tutor-header-actions button:hover,
.tutor-header-actions #btn-close-tutor:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  transform: scale(1.08) !important;
}

.tutor-header-actions #btn-close-tutor:hover {
  background: rgba(239, 68, 68, 0.8) !important;
  color: #ffffff !important;
}

/* Chat Messages Box */
.chat-messages {
  flex-grow: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  max-width: 85%;
  padding: 0.9rem 1.15rem;
  border-radius: 14px;
  font-size: calc(0.95rem * var(--font-scale));
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.message-user {
  background: var(--accent-color);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.message-ai {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.message-timestamp {
  font-size: 0.7rem;
  align-self: flex-end;
  opacity: 0.6;
}

/* sound waves & caption display (hearing support) */
.live-caption-display {
  background: rgba(0, 0, 0, 0.9);
  color: #ffff00;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: calc(1rem * var(--font-scale));
  font-weight: 700;
  border-top: 1px solid var(--border-color);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-visualizer-container {
  height: 36px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 1rem;
}

.visualizer-bar {
  width: 4px;
  height: 10px;
  background: var(--accent-color);
  border-radius: 2px;
  transition: height 0.05s ease;
}

/* Chat Input Bar */
.chat-input-bar {
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-input {
  flex-grow: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: 24px;
  outline: none;
  font-size: calc(0.95rem * var(--font-scale));
}
.chat-input:focus {
  border-color: var(--accent-color);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 24px;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-primary:hover {
  filter: brightness(1.15);
}

.btn-voice {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.2s ease;
}
.btn-voice.listening {
  background: #ef4444;
  color: #ffffff;
  animation: pulse-red 1.5s infinite;
  border-color: #ef4444;
}



/* Animations */
@keyframes pulse-red {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Footer & Additional Accessibility Shortcuts */
footer {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  background: var(--bg-secondary);
  font-size: calc(0.85rem * var(--font-scale));
  color: var(--text-secondary);
}
.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}


.keyboard-shortcut-guide {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

kbd,
.kbd-badge {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: monospace;
}


/* --- Auth & Profile Panels --- */
.hidden {
  display: none !important;
}

.auth-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  width: 100%;
}

.auth-panel.hidden {
  display: none !important;
}

.auth-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 960px;
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}


.auth-icon {
  font-size: 3rem;
  margin-bottom: -0.5rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  font-size: 2.5rem;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  margin-top: 1rem;
}

.auth-input {
  text-align: center;
  font-size: calc(1.1rem * var(--font-scale));
  padding: 1rem;
  border-radius: 12px;
}

.auth-submit {
  justify-content: center;
  padding: 1rem;
  font-size: calc(1.1rem * var(--font-scale));
  border-radius: 12px;
}

.profile-stats {
  width: 100%;
  display: none;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin: 1rem 0;
}


.stat-row {
  display: none;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}
.stat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}


.stat-value {
  font-size: calc(1.1rem * var(--font-scale));
}
.text-accent {
  color: var(--accent-secondary);
  font-weight: 800;
}


.profile-actions {
  display: none;
  gap: 1rem;
  width: 100%;
  justify-content: center;
}

/* --- Confetti Gamification Animation --- */
.confetti {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 20px;
  background-color: var(--accent-secondary);
  animation: fall linear forwards;
  z-index: 9999;
  pointer-events: none;
}

@keyframes fall {
  to {
    transform: translateY(100vh) rotate(720deg);
  }
}

@keyframes confettiFall {
  to {
    transform: translateY(100vh) rotate(720deg);
  }
}

/* --- My Notebook Styles --- */
.notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
}

.note-item {
  background: var(--bg-card);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--accent-primary);
  font-size: calc(1rem * var(--font-scale));
  text-align: left;
}


/* --- Collapsible Nav --- */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  background: transparent;
}

.nav-links:not(:has(> :not(.hidden))) {
  display: none;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}


#btn-mobile-chat {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 60px;
  height: 60px;
  border-radius: 30px;
  z-index: 9999;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  padding: 0;
}
#btn-close-tutor {
  display: none;
}
/* Old nav media query consolidated into unified mobile section */

/* --- Pulse Animation for Gamification Modal --- */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}


/* --- Premium Aesthetic Overrides --- */
.module-card, .profile-card, .auth-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
  border-radius: 16px;
  padding: 2rem;
}

.module-card:hover, .profile-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-main);
  border-color: var(--border-hover);
}

.btn-primary, .theme-btn {
  transition: all 0.3s ease;
  border-radius: 8px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(246, 211, 101, 0.3);
}

.theme-btn:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.welcome-title {
  background: var(--accent-gradient);
  color: var(--text-primary);
  background: none;
  display: inline-block;
}

#web-search-input {
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.2);
  color: var(--text-primary);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#web-search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(246, 211, 101, 0.2);
}

#pagination-controls button {
  padding: 0.5rem 1.5rem;
  font-weight: bold;
}


/* --- Modern Login Redesign --- */
.modern-auth-card {
  background: rgba(18, 18, 20, 0.45);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}



.theme-light .modern-auth-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.input-group-modern {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.theme-light .input-group-modern {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.input-group-modern:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(246, 211, 101, 0.15);
  background: rgba(0, 0, 0, 0.3);
}

.theme-light .input-group-modern:focus-within {
  background: rgba(255, 255, 255, 1);
}

.input-icon {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.input-group-modern:focus-within .input-icon {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.auth-input-modern {
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 1.25rem 1rem 1.25rem 3rem !important;
  font-size: 1.05rem;
  outline: none;
}

.auth-input-modern::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.modern-submit-btn {
  border-radius: 12px;
  padding: 1.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 10px 20px -5px rgba(246, 211, 101, 0.4);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modern-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px -5px rgba(246, 211, 101, 0.6);
  filter: brightness(1.1);
}

.modern-submit-btn:active {
  transform: translateY(1px);
  box-shadow: 0 5px 10px -5px rgba(246, 211, 101, 0.4);
}



/* --- Mobile FAB & Chat Slide-over --- */


@media (max-width: 1024px) {
  main {
    grid-template-columns: 1fr !important;
  }
}

/* --- Theme Toggle Switch --- */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--accent-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Landing Page Responsiveness */
@media (max-width: 600px) {
  .landing-hero h1 {
    font-size: 2rem !important;
  }
  .auth-card {
    padding: 1.5rem !important;
    max-width: 90% !important;
  }
  header, #main-header {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
  .logo-section {
    margin-bottom: 0 !important;
  }
}


/* Additional Mobile Responsiveness Polish */
@media (max-width: 600px) {
  main {
    padding: 1rem !important;
  }
  
  .dashboard-panel {
    gap: 1.5rem !important;
  }

  .welcome-banner {
    padding: 1.5rem !important;
    border-radius: 12px !important;
  }

  .welcome-title {
    font-size: 1.8rem !important;
  }

  #global-announcement-banner {
    padding: 1rem !important;
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .module-card {
    padding: 1.25rem !important;
  }
  
  .welcome-subtitle {
    font-size: 1rem !important;
  }
  
  /* Make sure inputs stay manageable */
  .auth-input-modern {
    font-size: 1rem !important;
  }
}


.chat-input-bar .btn-primary {
    flex-shrink: 0 !important;
}


/* --- Homepage Redesign --- */

.modern-landing {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 4rem 2rem;
}

.landing-container {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  max-width: 1200px;
  width: 100%;
  z-index: 10;
}

@media (min-width: 992px) {
  .landing-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.landing-hero-modern {
  flex: 1;
  max-width: 600px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  font-size: 0.85rem;
  color: var(--accent-color);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
  border-radius: 50%;
  animation: pulse-dot-anim 2s infinite;
}

@keyframes pulse-dot-anim {
  0% { box-shadow: 0 0 0 0 rgba(15, 92, 77, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(15, 92, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 92, 77, 0); }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.text-gradient {
  background: var(--accent-color);
  color: var(--text-primary);
  background: none;
  display: inline-block;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.hero-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1.05rem;
}

.feature-item svg {
  color: var(--accent-color);
}

.auth-card-modern {
  flex: 1;
  max-width: 450px;
  width: 100%;
}

.auth-glass-container {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.auth-heading {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.auth-subheading {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.auth-input-modern {
  background: rgba(15, 23, 42, 0.6) !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  padding: 1rem 1rem 1rem 3rem !important;
  font-size: 1rem !important;
  transition: all 0.3s ease !important;
}

.auth-input-modern:focus {
  background: rgba(15, 23, 42, 0.9) !important;
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 4px rgba(15, 92, 77, 0.2) !important;
  outline: none !important;
}

.modern-submit-btn {
  background: var(--accent-color)!important;
  border: none !important;
  border-radius: 12px !important;
  padding: 1rem !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(15, 92, 77, 0.4) !important;
}

.modern-submit-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(15, 92, 77, 0.6) !important;
}

.auth-footer-links {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.95rem;
}

.auth-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
  margin-left: 0.5rem;
}

.auth-link:hover {
  color: #818cf8;
}

.admin-discreet-link {
  text-align: center;
  margin-top: 1.5rem;
}

.admin-discreet-link a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.admin-discreet-link a:hover {
  color: var(--text-primary);
}

/* Floating Orbs Background */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  z-index: 0;
  animation: float-orb 20s infinite ease-in-out alternate;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: rgba(15, 92, 77, 0.4);
  top: -100px;
  left: -100px;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: rgba(236, 72, 153, 0.3);
  bottom: -50px;
  right: -50px;
  animation-delay: -5s;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: rgba(16, 185, 129, 0.2);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -10s;
}

@keyframes float-orb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -50px) scale(1.1); }
  100% { transform: translate(-20px, 20px) scale(0.9); }
}

/* --- Workspace Redesign & Visual Cues --- */

.workspace-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-main);
}

.bg-shape {
  position: absolute;
  filter: blur(100px);
  opacity: 0.4;
  border-radius: 50%;
  animation: float-shape 25s infinite ease-in-out alternate;
}

.shape-1 { width: 500px; height: 500px; background: rgba(15, 92, 77, 0.15); top: -100px; left: -100px; }
.shape-2 { width: 400px; height: 400px; background: rgba(236, 72, 153, 0.1); bottom: 10%; right: -50px; animation-delay: -5s; }
.shape-3 { width: 600px; height: 600px; background: rgba(16, 185, 129, 0.05); top: 30%; left: 40%; animation-delay: -10s; }

@keyframes float-shape {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -50px) scale(1.05); }
  100% { transform: translate(-30px, 30px) scale(0.95); }
}

/* Glassmorphic Module Cards */
.module-card {
  background: rgba(30, 41, 59, 0.6) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3) !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.module-card:hover {
  transform: translateY(-5px) scale(1.02) !important;
  border-color: var(--accent-color) !important;
  box-shadow: 0 20px 40px -10px rgba(15, 92, 77, 0.3) !important;
}

/* Glassmorphic Tutor Panel */
.tutor-panel {
  background: rgba(30, 41, 59, 0.6) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.tutor-header {
  background: rgba(15, 23, 42, 0.4) !important;
  backdrop-filter: blur(10px);
}

.chat-input-bar {
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.message-ai {
  background: var(--bg-accent)!important;
  border: 1px solid rgba(15, 92, 77, 0.2) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.message-user {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

/* Modal Overlay & Content */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 1.5rem 1rem;
  box-sizing: border-box;
  overflow-y: auto;
}

.modal-overlay.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.modal-content,
.glass-panel {
  background: var(--bg-card, rgba(15, 23, 42, 0.95));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  border-radius: 20px;
  width: 92%;
  max-width: 550px;
  max-height: min(88vh, 800px);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.6);
  transform: scale(1);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-sizing: border-box;
  margin: auto;
  overflow: hidden;
}

.modal-header {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  padding-bottom: 0.85rem;
  flex-shrink: 0;
}

.modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  padding-right: 0.5rem;
  padding-bottom: 0.5rem;
  margin-right: -0.25rem;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color, #0f5c4d) rgba(0, 0, 0, 0.08);
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background-color: var(--accent-color, #0f5c4d);
  border-radius: 4px;
}


/* Visual Cue Module */
#visual-cue-module {
  padding: 1rem;
  background: rgba(15, 92, 77, 0.1);
  border-bottom: 1px solid rgba(15, 92, 77, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

#visual-cue-module.hidden {
  display: none !important;
}

.visual-cue-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hand-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-color);
  animation: wave-hand 2s infinite ease-in-out;
}

.cue-waves {
  display: flex;
  gap: 4px;
  align-items: center;
}

.cue-waves span {
  display: inline-block;
  width: 4px;
  height: 12px;
  background-color: var(--accent-color);
  border-radius: 2px;
  animation: audio-wave 1.2s infinite ease-in-out;
}

.cue-waves span:nth-child(2) { animation-delay: 0.2s; height: 20px; }
.cue-waves span:nth-child(3) { animation-delay: 0.4s; }

.cue-text {
  margin: 0;
  font-weight: 600;
  color: var(--accent-color);
  letter-spacing: 0.5px;
}

@keyframes wave-hand {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
}

@keyframes audio-wave {
  0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
  50% { transform: scaleY(1.5); opacity: 1; }
}

/* --- Learner Card Adjustments --- */
.learner-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
}
.learner-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.theme-dark .learner-card {
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5) !important;
}

#main-header {
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.theme-dark #main-header {
  background-color: var(--bg-card) !important;
}

/* Nav Links Pill Hover */
#nav-links .theme-btn:hover {
  background-color: var(--bg-primary);
}

.theme-dark #nav-links .theme-btn:hover {
  background-color: rgba(255,255,255,0.1);
}

/* Hide tutor panel initially on desktop so cards span full width */
@media (min-width: 1025px) {
  main {
    grid-template-columns: 1fr !important;
  }
  /* Removed display none important to fix floating panel popup */
  .lesson-active .tutor-panel {
    display: flex !important;
  }
  main.lesson-active {
    grid-template-columns: 1fr 400px !important;
  }
}


/* =========================================
   CYBER-GLASS REDESIGN OVERRIDES
   ========================================= */

/* 1. Global Aesthetic & Deep Slate Backgrounds */
.theme-dark {
  --bg-primary: #111517;
  --bg-secondary: rgba(25, 31, 34, 0.9);
  --bg-card: #191f22;
  --bg-accent: rgba(44, 163, 137, 0.12);
  --text-primary: #f3f1ec;
  --text-secondary: #aeb8b4;
  --border-color: rgba(243, 241, 236, 0.1);
  --accent-color: #2ca389;
  --accent-secondary: #e57c42;
  --accent-gradient: var(--accent-color);
  --warning-color: #e57c42;
  --success-color: #10b981;
}

body {
  font-family: var(--font-main, 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif);
  background-image: none;
  background-attachment: fixed;
}

h1,
.auth-heading,
.welcome-title,
.brand-text {
  font-family: var(--font-display);
}

/* 2. Responsive Header */
#main-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  margin: 0;
  border-radius: 0;
  background: var(--bg-secondary) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-color) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  padding: 0.65rem 1.25rem !important;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

@media (min-width: 851px) {
  #main-header {
    top: 1rem;
    margin: 0 2rem 2rem 2rem;
    border-radius: 24px;
    border: 1px solid var(--border-color) !important;
    padding: 0.75rem 2rem !important;
    width: auto;
  }
}

#nav-links .theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 1rem;
  border-radius: 24px !important;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.25s ease;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}
#nav-links .theme-btn.active {
  border-color: var(--accent-color) !important;
  color: var(--accent-color) !important;
  background: rgba(15, 92, 77, 0.1) !important;
  box-shadow: 0 2px 10px rgba(15, 92, 77, 0.15);
}
#nav-links #btn-logout-main {
  border-color: rgba(245, 158, 11, 0.6);
  color: #d97706;
}
.theme-dark #nav-links #btn-logout-main {
  color: #fbbf24;
}
#nav-links .theme-btn.hidden {
  display: none !important;
}
.theme-dark #nav-links .theme-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: var(--shadow-main);
  color: var(--accent-color);
}

/* 3. Cinematic Learner Cards */
.theme-dark .learner-card {
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
  border-radius: 16px !important;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease !important;
}

.theme-dark .learner-card:hover {
  transform: translateY(-8px) scale(1.02) !important;
  border-color: rgba(212, 101, 40, 0.4) !important;
  box-shadow: var(--shadow-main);
}

.theme-dark .learner-body {
  background: transparent !important;
  border: none !important;
}

.theme-dark .learner-img-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--bg-accent);
}

.learner-card .btn-primary {
  background: var(--accent-gradient) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(15, 92, 77, 0.3) !important;
  transition: all 0.3s ease !important;
}
.learner-card .btn-primary:hover {
  box-shadow: 0 8px 25px rgba(212, 101, 40, 0.5) !important;
  transform: translateY(-2px) !important;
}

/* 4. Glassmorphic AI Tutor Panel */
/* Replaced by unified floating tutor styling */


/* Close button for popup */
#btn-close-tutor {
  position: absolute;
  top: 1rem;
  right: 1rem;
  left: auto !important;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
#btn-close-tutor:hover {
  background: rgba(244, 63, 94, 0.8);
  color: white;
}


/* --- Tutor Feedback UI Rework --- */
.tutor-feedback-module {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  gap: 0.4rem;
}

.tutor-feedback-module .live-caption-display {
  background: transparent;
  border: none;
  min-height: unset;
  padding: 0;
  color: var(--accent-color);
  font-weight: 600;
  text-shadow: 0 0 10px rgba(246, 211, 101, 0.3);
}

.tutor-feedback-module .audio-visualizer-container {
  margin: 0;
}

.btn-icon-only {
  width: 44px;
  height: 44px;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.btn-icon-only:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 15px rgba(246, 211, 101, 0.4);
}

.chat-input {
  flex: 1;
  min-width: 0;
}

.chat-input-bar .btn-voice {
  transition: all 0.3s ease;
}

.chat-input-bar .btn-voice:hover {
  transform: translateY(-2px);
  color: var(--accent-color);
  text-shadow: 0 0 10px rgba(246, 211, 101, 0.5);
}


/* --- Reader View Improvements --- */
#active-lesson-content {
  white-space: pre-wrap; /* Preserve natural line breaks */
  max-width: 800px;      /* Comfortable reading width */
  margin: 0 auto;        /* Center the text block */
  line-height: 1.8;      /* Give lines breathing room */
  font-size: 1.15rem;    /* Slightly larger text for readability */
  padding: 1rem 0;       /* Spacing at top and bottom */
  color: var(--text-secondary);
}

/* Fix the descriptor block above it to align */
#active-lesson-descriptor {
  max-width: 800px;
  margin: 0 auto 2rem auto;
}


/* --- Chat & Tooltip Updates --- */
.highlight-tooltip { position: absolute; z-index: 1000; background: var(--bg-card); border: 1px solid var(--border-color); padding: 5px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.highlight-tooltip button { font-size: 0.85rem; padding: 4px 8px; display: inline-flex; align-items: center; gap: 4px; }
.message-ai div p { margin-bottom: 0.5rem; }
.message-ai div p:last-child { margin-bottom: 0; }
.message-ai div ul, .message-ai div ol { margin-left: 1.5rem; margin-bottom: 0.5rem; }
.message-ai div pre { background: var(--bg-primary); padding: 0.5rem; border-radius: 4px; overflow-x: auto; }
.message-ai div code { font-family: monospace; background: var(--bg-primary); padding: 2px 4px; border-radius: 4px; }



/* =========================================
   FLOATING GLASSMORPHIC CHAT CARD REDESIGN
   ========================================= */

/* 1. Main Grid Layout Adjustment */
main {
  grid-template-columns: 1fr !important;
}

/* 2. Floating Tutor Panel */
.tutor-panel {
  position: fixed !important;
  bottom: calc(2rem + 68px) !important;
  right: 2rem !important;
  width: 420px !important;
  max-width: calc(100vw - 3rem) !important;
  height: 580px !important;
  max-height: calc(100vh - 120px) !important;
  top: auto !important;
  left: auto !important;
  
  background: rgba(15, 23, 42, 0.94) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  
  border: 1px solid rgba(15, 92, 77, 0.35) !important;
  border-radius: 20px !important;
  box-shadow: var(--shadow-main);
  z-index: 100000 !important;
  
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  transform-origin: bottom right !important;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.25s !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: scale(1) translateY(0) !important;
}

/* Hide the panel when minimized */
.tutor-panel.hidden-floating {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: scale(0.85) translateY(24px) !important;
  pointer-events: none !important;
}

/* 3. Panel Header */
.tutor-header {
  padding: 0.85rem 1.15rem !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(10px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem !important;
  cursor: grab !important;
  user-select: none !important;
}
.tutor-header:active { cursor: grabbing !important; }
.tutor-title { color: #fff !important; font-weight: 700 !important; font-size: 1.05rem !important; }
.tutor-header-actions { flex-shrink: 0 !important; display: flex !important; align-items: center !important; gap: 0.5rem !important; }
.tutor-header-actions button,
.tutor-header-actions #btn-close-tutor {
  position: static !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
}
.tutor-header-actions button:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}
.tutor-header-actions #btn-close-tutor:hover {
  background: rgba(239, 68, 68, 0.85) !important;
  color: #ffffff !important;
  border-color: rgba(239, 68, 68, 0.9) !important;
}
.tutor-header-actions button.tutor-muted,
.tutor-header-actions #btn-mute-tutor.tutor-muted {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35) !important;
}

/* 3.5 AI Tutor Multi-Conversation Tabs Bar */
.tutor-tabs-container {
  display: flex !important;
  align-items: center !important;
  padding: 0.45rem 0.75rem !important;
  background: rgba(10, 15, 29, 0.88) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  gap: 0.4rem !important;
  user-select: none !important;
  position: relative !important;
  z-index: 2 !important;
}

.tutor-tabs-list {
  display: flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  overflow-x: auto !important;
  scrollbar-width: thin !important;
  flex: 1 !important;
  padding: 0.15rem 0.1rem !important;
}

.tutor-tabs-list::-webkit-scrollbar {
  height: 4px !important;
}
.tutor-tabs-list::-webkit-scrollbar-track {
  background: transparent !important;
}
.tutor-tabs-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 4px !important;
}

.tutor-tab {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: 8px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.7) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  white-space: nowrap !important;
  max-width: 145px !important;
  flex-shrink: 0 !important;
}

.tutor-tab:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

.tutor-tab.active {
  background: var(--bg-accent)!important;
  border-color: rgba(15, 92, 77, 0.65) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 10px rgba(15, 92, 77, 0.28) !important;
}

.tutor-tab-title {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 90px !important;
}

.tutor-tab-close {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 4px !important;
  background: transparent !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.45) !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin-left: 2px !important;
  transition: all 0.15s ease !important;
}

.tutor-tab-close:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  color: #ef4444 !important;
}

.tutor-new-tab-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.8) !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
}

.tutor-new-tab-btn:hover {
  background: rgba(15, 92, 77, 0.35) !important;
  border-color: rgba(15, 92, 77, 0.65) !important;
  color: #ffffff !important;
  transform: scale(1.05) !important;
}

/* 4. Chat Bubbles */
.chat-messages {
  padding: 1.25rem !important;
  gap: 1.25rem !important;
  flex: 1 !important;
  overflow-y: auto !important;
}

.message {
  border-radius: 18px !important;
  padding: 1rem 1.2rem !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
  animation: messageSlideIn 0.25s ease-out forwards;
}

@keyframes messageSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-user {
  background: var(--accent-color)!important;
  color: #ffffff !important;
  border-bottom-right-radius: 4px !important;
  border: none !important;
  align-self: flex-end !important;
}

.message-ai {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border-bottom-left-radius: 4px !important;
  align-self: flex-start !important;
}

.message-timestamp {
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 0.75rem !important;
}

/* 5. Chat Input Bar */
.chat-input-bar {
  background: rgba(15, 23, 42, 0.7) !important;
  backdrop-filter: blur(10px) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 0.85rem 1.2rem !important;
  gap: 0.65rem !important;
  display: flex !important;
  align-items: center !important;
}

.chat-input {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-radius: 28px !important;
  padding: 0.7rem 1.15rem !important;
  flex: 1 !important;
  font-size: 0.92rem !important;
}
.chat-input::placeholder { color: rgba(255, 255, 255, 0.5) !important; }
.chat-input:focus { border-color: #d46528 !important; background: rgba(255, 255, 255, 0.1) !important; outline: none !important; }

.chat-input-bar .btn-primary {
  border-radius: 50% !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--accent-color)!important;
  box-shadow: 0 4px 15px rgba(212, 101, 40, 0.35) !important;
  border: none !important;
  cursor: pointer !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
}
.chat-input-bar .btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(212, 101, 40, 0.55) !important;
}

.chat-input-bar .btn-voice {
  border-radius: 50% !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}
.chat-input-bar .btn-voice:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}
.chat-input-bar .btn-voice.listening {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  box-shadow: var(--shadow-main);
}

/* 6. Typing Indicator Animation */
.typing-indicator {
  display: flex !important;
  align-items: center;
  gap: 5px;
  padding: 0.5rem 0.25rem;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* 7. Floating Action Launcher (Permanent, NEVER disappears) */
#fab-tutor {
  position: fixed !important;
  bottom: 2rem !important;
  right: 2rem !important;
  width: 58px !important;
  height: 58px !important;
  border-radius: 50% !important;
  background: var(--accent-color)!important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 8px 20px rgba(15, 61, 52, 0.22);
  z-index: 100001 !important; /* Above panel so it remains accessible */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s ease, box-shadow 0.3s ease !important;
}

#fab-tutor:hover {
  transform: scale(1.08) translateY(-3px) !important;
  box-shadow: 0 15px 35px rgba(15, 92, 77, 0.6) !important;
}

/* Morph launcher into close button when panel is open */
#fab-tutor.tutor-open {
  transform: rotate(90deg) scale(1) !important;
  background: var(--accent-color)!important;
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.5) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#fab-tutor .fab-icon-chat {
  display: block !important;
}
#fab-tutor .fab-icon-close {
  display: none !important;
}

#fab-tutor.tutor-open .fab-icon-chat {
  display: none !important;
}
#fab-tutor.tutor-open .fab-icon-close {
  display: block !important;
}

/* 8. Mobile Responsiveness */
@media (max-width: 768px) {
  .tutor-panel {
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 82vh !important;
    max-height: 82vh !important;
    border-radius: 24px 24px 0 0 !important;
  }
  #fab-tutor {
    bottom: 1.25rem !important;
    right: 1.25rem !important;
  }
  #fab-tutor.tutor-open {
    display: none !important;
  }
}


/* --- Student Profile Info & Pending Assignments Styling --- */
.student-profile-hero {
  background: var(--bg-accent);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
}

.student-profile-hero::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(15, 92, 77, 0.3), transparent 70%);
  pointer-events: none;
}

.student-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.student-info-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.student-info-badge:hover {
  transform: translateY(-2px);
  border-color: var(--accent-color);
}

.student-info-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.student-info-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.student-info-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Assignments Section */
.assignment-filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  flex-wrap: wrap;
}

.assignment-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1.15rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.assignment-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.assignment-tab-btn.active {
  background: var(--accent-color);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(15, 92, 77, 0.35);
}

.assignment-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
}

.assignment-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 92, 77, 0.4);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.assignment-card.completed {
  border-left: 4px solid var(--success-color, #10b981);
  opacity: 0.85;
}

.assignment-card.pending {
  border-left: 4px solid var(--warning-color, #f59e0b);
}

.assignment-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.assignment-subject-badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: rgba(15, 92, 77, 0.15);
  color: var(--accent-color);
  border: 1px solid rgba(15, 92, 77, 0.25);
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-pill.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.completed {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.assignment-submission-box {
  background: rgba(15, 92, 77, 0.08);
  border: 1px solid rgba(15, 92, 77, 0.25);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.25rem;
  transition: all 0.2s ease;
}

.theme-light .assignment-submission-box {
  background: rgba(15, 92, 77, 0.06);
  border-color: rgba(15, 92, 77, 0.2);
}

.theme-hc .assignment-submission-box {
  background: #000000;
  border: 2px solid #ffff00;
  color: #ffffff;
}

.assignment-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.toast-feedback {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  border: 1px solid var(--accent-color);
  padding: 0.85rem 1.75rem;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 1000000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  pointer-events: none;
}

.toast-feedback.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* =======================================================
   EMPTY STATE CARDS (Dashboard / Landing Page)
   ======================================================= */
.empty-state-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 2rem;
  width: 100%;
  margin: 1.5rem 0 2.5rem 0;
}

.empty-state-modern-card {
  background: rgba(30, 41, 59, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-light .empty-state-modern-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 92, 77, 0.2);
  box-shadow: 0 20px 45px -10px rgba(15, 92, 77, 0.12);
}

.empty-state-modern-card:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 92, 77, 0.4);
  box-shadow: 0 25px 50px -10px rgba(15, 92, 77, 0.25);
}

.empty-state-modern-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 0 0 4px 4px;
}

.empty-state-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-secondary);
  background: rgba(212, 101, 40, 0.12);
  border: 1px solid rgba(212, 101, 40, 0.3);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
}

.empty-state-illustration {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: var(--bg-accent);
  border: 1px solid rgba(15, 92, 77, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  margin-bottom: 1.75rem;
  transition: transform 0.3s ease;
}

.empty-state-modern-card:hover .empty-state-illustration {
  transform: scale(1.08) rotate(3deg);
}

.empty-state-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.empty-state-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 320px;
  margin-bottom: 2rem;
  flex: 1;
}

.empty-state-actions {
  margin-top: auto;
  width: 100%;
}

/* =======================================================
   PORTAL SELECTOR TABS (Login Page)
   ======================================================= */
.portal-selector-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 4px;
  margin-bottom: 1.75rem;
  width: 100%;
  gap: 4px;
}

.theme-light .portal-selector-tabs {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.portal-tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.portal-tab-btn:hover {
  color: var(--text-primary);
}

.portal-tab-btn.active {
  background: var(--accent-color);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(15, 92, 77, 0.4);
}

.theme-light .portal-tab-btn.active {
  color: #ffffff !important;
}

.demo-quick-login-card {
  background: rgba(15, 92, 77, 0.12);
  border: 1px dashed rgba(15, 92, 77, 0.45);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.demo-quick-login-card:hover {
  background: rgba(15, 92, 77, 0.22);
  transform: translateY(-2px);
  border-color: var(--accent-color);
}

.demo-quick-login-btn {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

/* =======================================================
   INSTRUCTOR DASHBOARD
   ======================================================= */
.instructor-hero-banner {
  background: var(--bg-accent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(15, 92, 77, 0.35);
  border-radius: 24px;
  padding: 2.25rem;
  margin-bottom: 2rem;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.theme-light .instructor-hero-banner {
  background: var(--accent-color);
  border-color: rgba(15, 92, 77, 0.25);
  box-shadow: 0 15px 35px rgba(15, 92, 77, 0.1);
}

.instructor-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.instructor-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.instructor-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-color);
}

.instructor-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--bg-accent);
  border: 1px solid rgba(15, 92, 77, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.instructor-stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.instructor-stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 0.25rem;
}

.curriculum-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.theme-light .curriculum-action-bar {
  background: rgba(241, 245, 249, 0.8);
}

.course-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.course-item-row:hover {
  border-color: rgba(15, 92, 77, 0.4);
  background: var(--bg-card);
}

.accommodation-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
}

.acc-standard { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }
.acc-low-vision { background: rgba(15, 92, 77, 0.15); color: #818cf8; border: 1px solid rgba(15, 92, 77, 0.3); }
.acc-auditory { background: rgba(212, 101, 40, 0.15); color: #22d3ee; border: 1px solid rgba(212, 101, 40, 0.3); }
.acc-dyslexia { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* --- Logout Button Polished Styling --- */
#btn-logout-main,
.btn-logout-main,
.btn-instructor-logout,
.btn-student-profile-logout,
#btn-modal-logout {
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  user-select: none;
}

#btn-logout-main:hover,
.btn-logout-main:hover,
.btn-instructor-logout:hover,
.btn-student-profile-logout:hover,
#btn-modal-logout:hover {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #ef4444 !important;
  border-color: #ef4444 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25) !important;
}

#btn-logout-main:focus-visible,
.btn-logout-main:focus-visible,
.btn-instructor-logout:focus-visible,
.btn-student-profile-logout:focus-visible,
#btn-modal-logout:focus-visible {
  outline: 2px solid #ef4444 !important;
  outline-offset: 2px !important;
}

#btn-logout-main:active,
.btn-logout-main:active,
.btn-instructor-logout:active,
.btn-student-profile-logout:active,
#btn-modal-logout:active {
  transform: translateY(0) scale(0.98);
}

/* --- Hands-Free Voice Command System (Pillar 3) --- */
.btn-voice-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 20px;
  padding: 0.35rem 0.95rem;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(15, 92, 77, 0.1);
  user-select: none;
}

.btn-voice-nav:hover {
  border-color: var(--accent-color) !important;
  color: var(--accent-color) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 92, 77, 0.28);
}

.btn-voice-nav.listening {
  background: rgba(15, 92, 77, 0.16) !important;
  border-color: #0f5c4d !important;
  color: #0f5c4d !important;
  box-shadow: 0 0 16px rgba(15, 92, 77, 0.35) !important;
}

.voice-nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  display: inline-block;
  transition: all 0.25s ease;
}

.btn-voice-nav.listening .voice-nav-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseVoiceDot 1.2s infinite ease-in-out;
}

@keyframes pulseVoiceDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Floating Voice Command HUD */
.voice-command-hud {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  max-width: 580px;
  width: calc(100% - 2rem);
  pointer-events: auto;
  animation: slideDownVoiceHud 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.voice-command-hud.hidden {
  display: none !important;
}

@keyframes slideDownVoiceHud {
  from { opacity: 0; transform: translate(-50%, -15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.voice-hud-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--accent-color);
  border-radius: 40px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), 0 0 25px rgba(15, 92, 77, 0.25);
  transition: all 0.25s ease;
}

.voice-command-hud.action-matched .voice-hud-container {
  border-color: #10b981 !important;
  box-shadow: 0 12px 35px rgba(16, 185, 129, 0.25), 0 0 24px rgba(16, 185, 129, 0.4) !important;
}

.voice-hud-indicator {
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: rgba(15, 92, 77, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.voice-pulse-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(15, 92, 77, 0.5);
  animation: voicePulseRing 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes voicePulseRing {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

.voice-hud-text-area {
  flex: 1;
  overflow: hidden;
}

.voice-hud-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-hud-transcript {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-hud-btn-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.voice-hud-action-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.2s;
}

.voice-hud-action-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--accent-color);
}

/* Modal styling for Voice Help */
.modal-backdrop-custom {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop-custom.hidden {
  display: none !important;
}

.modal-card-custom {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: popInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popInModal {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header-custom {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.voice-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.voice-guide-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem;
}

.guide-category {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.6rem;
}

.guide-phrase {
  font-size: 0.82rem;
  color: var(--text-primary);
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Header Settings Gear Icon Button */
.btn-header-settings {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-header-settings:hover {
  color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  background: rgba(15, 92, 77, 0.12) !important;
  transform: rotate(45deg);
  box-shadow: 0 4px 14px rgba(15, 92, 77, 0.28);
}

.btn-header-settings:active {
  transform: rotate(45deg) scale(0.95);
}

.btn-header-settings:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* =======================================================
   STUDENT VOICE ISOLATION & BIOMETRICS CONTROLS
   ======================================================= */
.gismo-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  margin: 0;
  cursor: pointer;
}
.gismo-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.gismo-toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #475569;
  border-radius: 24px;
  transition: 0.25s ease;
}
.gismo-toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}
.gismo-toggle-switch input:checked + .gismo-toggle-slider {
  background-color: var(--accent-color, #0f5c4d);
}
.gismo-toggle-switch input:checked + .gismo-toggle-slider::before {
  transform: translateX(20px);
}

.voice-calibration-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.voice-meter-bar-container {
  height: 8px;
  background: rgba(15, 92, 77, 0.15);
  border-radius: 6px;
  overflow: hidden;
}

.voice-meter-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #0f5c4d);
  border-radius: 6px;
  transition: width 0.08s ease;
}

#btn-calibrate-voice {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}
#btn-calibrate-voice:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}
#btn-reset-voiceprint {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
  transition: all 0.2s ease;
}
#btn-reset-voiceprint:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* =======================================================
   ADMIN DATABASE EXPLORER STYLING
   ======================================================= */
.admin-subnav-btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
}

.admin-subnav-btn:hover {
  border-color: var(--accent-color);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.admin-subnav-btn.active {
  background: var(--accent-color) !important;
  color: #ffffff !important;
  border-color: var(--accent-color) !important;
  box-shadow: 0 4px 14px rgba(15, 92, 77, 0.3);
}

.db-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.db-pill-btn:hover {
  border-color: var(--accent-color);
  background: var(--bg-card);
  transform: translateY(-1px);
}

.db-pill-btn.active {
  background: var(--bg-accent);
  border-color: var(--accent-color);
  color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(15, 92, 77, 0.2);
}

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

.db-table th {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  text-align: left;
  user-select: none;
  white-space: nowrap;
}

.db-table th.sortable:hover {
  color: var(--accent-color);
  cursor: pointer;
}

.db-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  white-space: nowrap;
  vertical-align: middle;
}

.db-table tr:hover td {
  background: rgba(15, 92, 77, 0.05);
}

.db-cell-truncate {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.db-cell-truncate:hover {
  background: rgba(15, 92, 77, 0.15);
  color: var(--accent-color);
}

.db-badge-pk {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 6px;
  font-weight: 700;
  margin-left: 4px;
}

.db-badge-type {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-family: monospace;
}

/* ====================================================================
   QUIZ SYSTEM STYLES (Accessible, Responsive, & Modern)
   ==================================================================== */
.quiz-hub-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quiz-subnav-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  flex-wrap: wrap;
}

.quiz-subnav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.6rem 1.4rem;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.quiz-subnav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
  border-color: var(--border-hover);
}

.quiz-subnav-btn.active {
  background: var(--accent-gradient, var(--accent-color));
  color: #ffffff !important;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(15, 92, 77, 0.35);
}

.quiz-card-student {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
}

.quiz-card-student:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card, 0 8px 24px rgba(0, 0, 0, 0.1));
}

.quiz-chip-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 20px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.quiz-chip-btn:hover {
  background: rgba(15, 92, 77, 0.15);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: scale(1.03);
}

.admin-quiz-q-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  transition: border-color 0.2s ease;
}

.admin-quiz-q-card:hover {
  border-color: var(--border-hover);
}

.quiz-runner-modal-dialog {
  background: var(--bg-primary);
  border: 2px solid var(--border-hover);
  border-radius: 20px;
  max-width: 720px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.quiz-runner-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
}

.quiz-runner-body {
  padding: 1.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quiz-runner-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  gap: 0.75rem;
}

.quiz-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.quiz-progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient, var(--accent-color));
  width: 0%;
  transition: width 0.3s ease;
}

.quiz-option-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-size: 1rem;
  color: var(--text-primary);
  width: 100%;
  position: relative;
}

.quiz-option-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-color);
  transform: translateX(3px);
}

.quiz-option-btn:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

.quiz-option-btn.selected {
  background: rgba(15, 92, 77, 0.12);
  border-color: var(--accent-color);
  box-shadow: 0 0 0 1px var(--accent-color);
}

.quiz-option-letter {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.quiz-option-btn.selected .quiz-option-letter {
  background: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
}

.quiz-breakdown-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.25rem;
  border-left: 5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quiz-breakdown-card.correct {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.quiz-breakdown-card.incorrect {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.quiz-explanation-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* --- Quiz Voice Answer Feature Styles --- */
.quiz-voice-header-btn {
  border-radius: 10px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  transition: all 0.2s ease;
  font-weight: 600;
}

.quiz-voice-header-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.quiz-voice-header-btn.listening {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: #10b981 !important;
  color: #10b981 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}

.quiz-voice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  display: inline-block;
  transition: all 0.2s ease;
}

.quiz-voice-header-btn.listening .quiz-voice-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseVoiceDot 1.2s infinite ease-in-out;
}

.quiz-voice-bar {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 0.9rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: all 0.25s ease;
}

.quiz-voice-bar.listening {
  border-color: var(--accent-color);
  background: rgba(15, 92, 77, 0.08);
  box-shadow: 0 4px 20px rgba(15, 92, 77, 0.14);
}

.quiz-voice-bar.matched {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.quiz-voice-bar.error {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.quiz-voice-bar-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.quiz-voice-mic-btn {
  position: relative;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s ease;
  padding: 0;
}

.quiz-voice-mic-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: scale(1.05);
}

.quiz-voice-bar.listening .quiz-voice-mic-btn {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(15, 92, 77, 0.45);
}

.quiz-voice-bar.matched .quiz-voice-mic-btn {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.quiz-voice-mic-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--accent-color);
  opacity: 0;
  pointer-events: none;
}

.quiz-voice-bar.listening .quiz-voice-mic-ring {
  opacity: 1;
  animation: voicePulseRing 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.quiz-voice-bar-text {
  flex: 1;
  min-width: 0;
}

.quiz-voice-status-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.quiz-voice-status-subtext {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.quiz-voice-status-subtext kbd {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.quiz-voice-auto-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.65rem;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.2s ease;
}

.quiz-voice-auto-label:hover {
  border-color: var(--accent-color);
  color: var(--text-primary);
}

.quiz-voice-auto-label input {
  accent-color: var(--accent-color);
  cursor: pointer;
  margin: 0;
}

.quiz-voice-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border-color);
}

.quiz-voice-hint-chip {
  font-size: 0.74rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.18rem 0.55rem;
  font-weight: 500;
}

.quiz-option-btn.voice-selected-pulse {
  animation: quizOptionVoicePulse 0.6s ease;
}

@keyframes quizOptionVoicePulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.02); box-shadow: 0 0 20px rgba(16, 185, 129, 0.45); border-color: #10b981; }
  100% { transform: scale(1); }
}



/* ==========================================================================
   COMPREHENSIVE MOBILE RESPONSIVENESS DESIGN SYSTEM
   Ultra-polished layouts for Phones (<= 480px) and Tablets (<= 850px)
   ========================================================================== */

/* Universal Mobile Overflow Guard */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

.workspace-bg {
  max-width: 100vw;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.bg-shape, .orb {
  max-width: 75vw !important;
  pointer-events: none !important;
}

/* Base Nav Toggle */
#nav-toggle {
  display: none;
}

#nav-toggle.hidden {
  display: none !important;
}

.admin-panel-section {
  padding: 2rem;
  max-width: 1350px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* -------------------------------------------------------------
   TABLET & SMARTPHONE BREAKPOINT (max-width: 850px)
   ------------------------------------------------------------- */
@media (max-width: 850px) {

  /* --- 0. Universal Box-Sizing & Grid Protection --- */
  *, *::before, *::after {
    box-sizing: border-box !important;
  }

  main, #main-content, .dashboard-panel, .welcome-banner, #modules-list, .col-12 {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .row > * {
    padding-left: 0.4rem !important;
    padding-right: 0.4rem !important;
  }
  #modules-list {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }

  /* --- 1. Sticky Mobile Header, Voice HUD & Navigation Drawer --- */
  #main-header {
    top: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 0.55rem 0.85rem !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    width: 100% !important;
    max-width: 100vw !important;
    background: var(--bg-card) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid var(--border-color) !important;
    z-index: 10000 !important;
    gap: 0.4rem !important;
  }

  #main-header .logo-section {
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }

  #main-header .logo-section img {
    display: block !important;
    width: 28px !important;
    height: 28px !important;
  }

  #main-header .logo-section .logo-text {
    display: block !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
  }

  .header-controls {
    gap: 0.35rem !important;
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
  }

  .btn-voice-nav {
    padding: 0.35rem 0.55rem !important;
    font-size: 0.78rem !important;
    border-radius: 20px !important;
  }

  .voice-nav-text {
    display: none !important;
  }

  .theme-switch-group {
    padding: 0.2rem 0.4rem !important;
    gap: 0.3rem !important;
  }

  /* Hamburger Toggle Button */
  #nav-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
  }

  #nav-toggle.hidden {
    display: none !important;
  }

  #nav-toggle:hover, #nav-toggle:focus-visible {
    background: var(--border-hover) !important;
    color: var(--accent-color) !important;
  }

  /* Slide-Down Navigation Drawer */
  .nav-links {
    position: fixed !important;
    top: 53px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    background: #111517 !important;
    border-bottom: 2px solid var(--border-color) !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 1rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.55rem !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9) !important;
    z-index: 99999 !important;
    transform: translateY(0) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease !important;
    max-height: calc(100vh - 53px) !important;
    overflow-y: auto !important;
  }

  .theme-light .nav-links {
    background: #ffffff !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.22) !important;
  }

  .nav-links.collapsed:not(.mobile-open) {
    display: none !important;
    transform: translateY(-110%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .nav-links.mobile-open {
    display: flex !important;
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .nav-links .theme-btn {
    width: 100% !important;
    text-align: left !important;
    justify-content: flex-start !important;
    padding: 0.75rem 1.15rem !important;
    border-radius: 12px !important;
    font-size: 0.98rem !important;
    min-height: 46px !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
  }

  .nav-links .theme-btn.hidden,
  #nav-links .theme-btn.hidden {
    display: none !important;
  }

  /* Floating Voice HUD on Mobile */
  .voice-command-hud {
    top: 62px !important;
    width: calc(100vw - 1.25rem) !important;
    max-width: calc(100vw - 1.25rem) !important;
  }

  .voice-hud-container {
    padding: 0.6rem 0.9rem !important;
    gap: 0.65rem !important;
    border-radius: 24px !important;
  }

  /* --- 2. Landing Page & Authentication Hero --- */
  .landing-section, .modern-landing {
    padding: 1.5rem 0.85rem 3rem 0.85rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-height: auto !important;
  }

  .landing-container {
    gap: 1.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .landing-hero-modern {
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .hero-badge {
    margin: 0 auto 0.85rem auto !important;
    font-size: 0.78rem !important;
    padding: 0.35rem 0.8rem !important;
  }

  .hero-title {
    font-size: 2.15rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.75rem !important;
  }

  .hero-subtitle {
    font-size: 0.95rem !important;
    margin-bottom: 1.25rem !important;
    padding: 0 0.25rem !important;
    line-height: 1.5 !important;
  }

  .hero-features {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.65rem !important;
  }

  .feature-item {
    font-size: 0.85rem !important;
    gap: 0.45rem !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--border-color) !important;
    padding: 0.4rem 0.75rem !important;
    border-radius: 20px !important;
  }

  .feature-item svg {
    width: 16px !important;
    height: 16px !important;
  }

  .auth-card-modern {
    max-width: 100% !important;
    width: 100% !important;
  }

  .auth-glass-container {
    padding: 1.4rem 1.1rem !important;
    border-radius: 20px !important;
    width: 100% !important;
  }

  .portal-selector-tabs {
    display: flex !important;
    width: 100% !important;
    gap: 0.35rem !important;
    margin-bottom: 1.25rem !important;
  }

  .portal-tab-btn {
    flex: 1 !important;
    font-size: 0.84rem !important;
    padding: 0.6rem 0.4rem !important;
    justify-content: center !important;
  }

  .portal-tab-btn span {
    font-size: 0.8rem !important;
  }

  .portal-tab-btn svg {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0 !important;
  }

  .demo-quick-login-card {
    flex-wrap: wrap !important;
    padding: 0.75rem 0.85rem !important;
  }

  .auth-input-modern {
    padding: 0.85rem 0.85rem 0.85rem 2.75rem !important;
    font-size: 0.95rem !important;
    width: 100% !important;
  }

  .modern-submit-btn {
    min-height: 46px !important;
    font-size: 0.98rem !important;
  }

  /* --- 3. Student Dashboard, Empty State & Active Lesson Reader --- */
  #main-content, #profile-panel, #library-panel, #quizzes-panel, #admin-panel, #admin-db-panel, .admin-panel-section {
    padding: 0.85rem 0.65rem !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .welcome-banner {
    padding: 1.25rem 1rem !important;
    border-radius: 16px !important;
    margin-bottom: 1.25rem !important;
  }

  .welcome-title {
    font-size: 1.45rem !important;
    line-height: 1.25 !important;
  }

  .welcome-subtitle {
    font-size: 0.88rem !important;
  }

  /* Empty State Grid on Mobile */
  .empty-state-card-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    margin: 1rem 0 1.5rem 0 !important;
  }

  .empty-state-modern-card {
    padding: 1.75rem 1.15rem !important;
    border-radius: 18px !important;
  }

  /* Active Lesson Reader on Mobile */
  .lesson-container, #lesson-active-container {
    padding: 1.15rem 0.95rem !important;
    gap: 1.1rem !important;
  }

  .lesson-header {
    gap: 0.5rem !important;
  }

  .narrator-control-block {
    padding: 0.75rem !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
  }

  .narrator-control-block button {
    flex: 1 1 auto !important;
    justify-content: center !important;
    font-size: 0.85rem !important;
    padding: 0.55rem 0.8rem !important;
  }

  .narrator-control-block #btn-start-quiz {
    width: 100% !important;
    margin-left: 0 !important;
    flex: 1 1 100% !important;
  }

  #active-lesson-content {
    font-size: 1rem !important;
    line-height: 1.65 !important;
  }

  #pagination-controls {
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
  }

  #pagination-controls button {
    padding: 0.45rem 1rem !important;
    font-size: 0.88rem !important;
  }

  /* --- 4. Student Profile & Coursework --- */
  #profile-panel .auth-card {
    padding: 1.1rem 0.85rem !important;
    border-radius: 18px !important;
  }

  .student-profile-hero {
    padding: 1.15rem 0.95rem !important;
    border-radius: 16px !important;
    margin-bottom: 1.25rem !important;
  }

  .student-profile-hero .d-flex {
    flex-wrap: wrap !important;
  }

  .student-info-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
    margin-top: 1.1rem !important;
  }

  .student-info-badge {
    padding: 0.75rem 0.9rem !important;
    width: 100% !important;
  }

  .module-card, .profile-card {
    padding: 1.15rem 0.95rem !important;
    width: 100% !important;
  }

  .assignment-card {
    padding: 1.1rem 0.95rem !important;
  }

  .assignment-submission-box {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  .assignment-actions-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .assignment-actions-row > div {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 0.45rem !important;
  }

  .assignment-actions-row button,
  .assignment-actions-row label {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }

  /* --- 5. Library & File Upload Section --- */
  .library-search-row,
  .library-upload-row,
  #file-upload-form,
  .search-row,
  .upload-form-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    width: 100% !important;
  }

  #web-search-input,
  input[type="file"],
  input#file-upload {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 44px !important;
  }

  .library-search-row button,
  .library-upload-row button,
  .btn-upload,
  #btn-search-books {
    width: 100% !important;
    justify-content: center !important;
    min-height: 44px !important;
    padding: 0.65rem 1rem !important;
  }

  /* --- 6. Interactive Quizzes Hub & Quiz Runner Modal --- */
  .quiz-subnav-btn {
    flex: 1 1 auto !important;
    justify-content: center !important;
    padding: 0.55rem 1rem !important;
    font-size: 0.88rem !important;
  }

  .quiz-card-student {
    padding: 1.15rem 1rem !important;
  }

  #quiz-modal {
    padding: 0.5rem !important;
  }

  .quiz-runner-modal-dialog {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 92vh !important;
    border-radius: 16px !important;
    margin: auto !important;
  }

  .quiz-runner-header {
    padding: 0.85rem 1rem !important;
    flex-wrap: wrap !important;
    gap: 0.6rem !important;
  }

  #quiz-runner-title {
    font-size: 1.05rem !important;
  }

  .quiz-voice-header-btn,
  #btn-quiz-read-question {
    padding: 0.35rem 0.6rem !important;
    font-size: 0.78rem !important;
  }

  #quiz-progress-section {
    padding: 0.55rem 1rem 0.2rem 1rem !important;
  }

  .quiz-runner-body {
    padding: 1rem !important;
    gap: 1rem !important;
  }

  #quiz-question {
    font-size: 1.08rem !important;
    line-height: 1.4 !important;
  }

  .quiz-option-btn {
    padding: 0.75rem 0.85rem !important;
    min-height: 48px !important;
    font-size: 0.9rem !important;
    gap: 0.75rem !important;
  }

  .quiz-option-letter {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.85rem !important;
  }

  /* Quiz Voice Bar on Mobile */
  .quiz-voice-bar {
    padding: 0.75rem 0.85rem !important;
    gap: 0.5rem !important;
  }

  .quiz-voice-bar-main {
    flex-wrap: wrap !important;
    gap: 0.65rem !important;
  }

  .quiz-voice-mic-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
  }

  .quiz-voice-bar-text {
    flex: 1 1 calc(100% - 52px) !important;
  }

  .quiz-voice-status-title {
    font-size: 0.85rem !important;
  }

  .quiz-voice-status-subtext {
    font-size: 0.76rem !important;
  }

  .quiz-voice-auto-label {
    margin-left: auto !important;
    font-size: 0.74rem !important;
    padding: 0.25rem 0.55rem !important;
  }

  .quiz-voice-hints {
    gap: 0.3rem !important;
  }

  .quiz-voice-hint-chip {
    font-size: 0.68rem !important;
    padding: 0.14rem 0.45rem !important;
  }

  .quiz-runner-footer {
    padding: 0.8rem 1rem !important;
  }

  #quiz-controls-active {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  #quiz-controls-active button {
    padding: 0.5rem 0.85rem !important;
    font-size: 0.85rem !important;
  }

  /* --- 7. Teacher Admin Dashboard & Database Views --- */
  .instructor-hero-banner {
    padding: 1.25rem 1rem !important;
    border-radius: 18px !important;
    margin-bottom: 1.25rem !important;
  }

  .instructor-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
    margin-bottom: 1.25rem !important;
  }

  .instructor-stat-card {
    padding: 1rem !important;
    gap: 0.85rem !important;
  }

  .instructor-stat-icon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
  }

  .instructor-stat-value {
    font-size: 1.4rem !important;
  }

  .curriculum-action-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 0.9rem !important;
  }

  .curriculum-action-bar > div.d-flex {
    flex-wrap: wrap !important;
    width: 100% !important;
  }

  .curriculum-action-bar button {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }

  .course-item-row {
    flex-wrap: wrap !important;
    padding: 0.85rem 0.95rem !important;
    gap: 0.65rem !important;
  }

  #admin-announcement-input {
    min-width: 0 !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  #admin-announcement-input + button {
    width: 100% !important;
    justify-content: center !important;
  }

  #db-view-tables-mode [style*="min-width:280px"] {
    min-width: 0 !important;
    width: 100% !important;
  }

  /* Table Horizontal Scrolling without viewport blowouts */
  .table-responsive, .db-table-container, [style*="overflow-x:auto"], [style*="overflow-x: auto"] {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
    border-radius: 12px !important;
  }

  table {
    min-width: 480px !important;
  }

  /* --- 8. Modals (Settings, Voice Help, Submissions, Cell Detail) --- */
  .modal-card-custom {
    width: 94vw !important;
    max-width: 94vw !important;
    margin: 0.75rem auto !important;
    max-height: 88vh !important;
  }

  #settings-modal .modal-content,
  #settings-modal .glass-panel {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 1.15rem 1rem !important;
    max-height: 90vh !important;
    overflow: hidden !important;
  }

  #settings-modal .modal-body {
    overflow-y: auto !important;
  }

  #voice-select {
    min-width: 0 !important;
    padding-left: 0.75rem !important;
  }

  /* --- 9. AI Tutor Mobile Bottom Sheet & Floating FAB --- */
  .tutor-panel {
    position: fixed !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    top: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 82vh !important;
    max-height: 82vh !important;
    border-radius: 20px 20px 0 0 !important;
    margin: 0 !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8) !important;
    z-index: 100000 !important;
    transform-origin: bottom center !important;
  }

  .tutor-panel.hidden-floating {
    transform: translateY(100%) scale(0.95) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .tutor-feedback-module {
    padding: 0.5rem 0.75rem !important;
  }

  #fab-tutor {
    bottom: 1.15rem !important;
    right: 1.15rem !important;
    width: 52px !important;
    height: 52px !important;
    z-index: 9999 !important;
  }

  footer {
    padding: 1.15rem 1rem !important;
    text-align: center !important;
  }

  .footer-container,
  .keyboard-shortcut-guide {
    justify-content: center !important;
    font-size: 0.78rem !important;
  }
}

/* -------------------------------------------------------------
   COMPACT SMARTPHONE BREAKPOINT (max-width: 480px)
   ------------------------------------------------------------- */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.85rem !important;
  }

  .instructor-stats-grid {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .portal-tab-btn {
    font-size: 0.78rem !important;
    padding: 0.5rem 0.25rem !important;
  }

  .portal-tab-btn span {
    font-size: 0.75rem !important;
  }

  #btn-quiz-voice-label {
    display: none !important;
  }

  #quiz-controls-active {
    justify-content: space-between !important;
  }

  #quiz-controls-active > div {
    flex: 1 !important;
    justify-content: flex-end !important;
  }
}

/* Clean editorial surface without neon gradient blobs */
.workspace-bg, .bg-shape { display: none !important; }

/* --- Redesigned AI Tutor Card (Editorial Warm Palette) --- */
#tutor-panel.tutor-panel {
  border-radius: 22px !important;
  border: 1px solid #e5dfd5 !important;
  background: #fbf9f5 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.14) !important;
  overflow: hidden !important;
  transition: width 0.22s ease, height 0.22s ease, max-height 0.22s ease, opacity 0.2s ease, transform 0.2s ease !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel.tutor-panel {
  background: #141918 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55) !important;
}

#tutor-panel.tutor-panel.tutor-expanded {
  width: min(640px, calc(100vw - 2rem)) !important;
  height: min(82vh, 760px) !important;
  max-height: 86vh !important;
}

#tutor-panel .tutor-header {
  background: #efece4 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid #e2dbd0 !important;
  padding: 0.9rem 1.15rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .tutor-header {
  background: #1c2422 !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

#tutor-panel .tutor-avatar {
  width: 44px !important;
  height: 44px !important;
  border-radius: 14px !important;
  background: rgba(15, 92, 77, 0.08) !important;
  color: #1e293b !important;
  border: 1px solid #d9d2c5 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .tutor-avatar {
  background: rgba(15, 92, 77, 0.22) !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

#tutor-panel .tutor-title-stack {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

#tutor-panel .tutor-title {
  font-family: var(--font-display) !important;
  font-size: 1.18rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  line-height: 1.15 !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .tutor-title {
  color: #f8fafc !important;
}

#tutor-panel .tutor-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#tutor-panel .antigravity-pill {
  background: #e3dfd4 !important;
  color: #334155 !important;
  border: none !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  padding: 0.14rem 0.55rem !important;
  border-radius: 999px !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .antigravity-pill {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}

#tutor-panel .tutor-status {
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  color: #0f5c4d !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.32rem !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .tutor-status {
  color: #34d399 !important;
}

#tutor-panel .tutor-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
}

#tutor-panel .tutor-header-actions button,
#tutor-panel .tutor-header-actions #btn-close-tutor {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.75) !important;
  color: #1e293b !important;
  border: 1px solid #d9d2c5 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  box-shadow: none !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .tutor-header-actions button,
body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .tutor-header-actions #btn-close-tutor {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

#tutor-panel .tutor-header-actions button:hover,
#tutor-panel .tutor-header-actions #btn-close-tutor:hover {
  background: #ffffff !important;
  color: #0f5c4d !important;
  border-color: #0f5c4d !important;
}

#tutor-panel .tutor-tabs-container {
  background: #fbf9f5 !important;
  border-bottom: 1px solid #e5dfd5 !important;
  padding: 0 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .tutor-tabs-container {
  background: #141918 !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

#tutor-panel .tutor-tabs-list {
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  padding: 0 !important;
}

#tutor-panel .tutor-tab {
  background: transparent !important;
  border: none !important;
  border-bottom: 2.5px solid transparent !important;
  border-radius: 0 !important;
  padding: 0.65rem 0.75rem !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
}

#tutor-panel .tutor-tab.active {
  color: #0f172a !important;
  border-bottom-color: #0f5c4d !important;
  background: transparent !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .tutor-tab {
  color: #94a3b8 !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .tutor-tab.active {
  color: #f8fafc !important;
  border-bottom-color: #34d399 !important;
}

#tutor-panel .tutor-new-tab-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.3rem !important;
  background: transparent !important;
  border: none !important;
  color: #1e293b !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  padding: 0.45rem 0.55rem !important;
  border-radius: 8px !important;
  width: auto !important;
  height: auto !important;
  flex-shrink: 0 !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .tutor-new-tab-btn {
  color: #e2e8f0 !important;
}

#tutor-panel .tutor-new-tab-btn:hover {
  background: rgba(15, 92, 77, 0.08) !important;
  color: #0f5c4d !important;
}

#tutor-panel .chat-messages {
  background: #fbf9f5 !important;
  padding: 1rem 1.1rem !important;
  gap: 0.85rem !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .chat-messages {
  background: #141918 !important;
}

#tutor-panel .message {
  box-shadow: none !important;
}

#tutor-panel .message-user {
  background: #0f5c4d !important;
  color: #ffffff !important;
  border-radius: 14px 14px 4px 14px !important;
  padding: 0.7rem 1rem !important;
  font-size: 0.91rem !important;
  box-shadow: 0 3px 10px rgba(15, 92, 77, 0.14) !important;
}

#tutor-panel .message-ai {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: #1e293b !important;
  border: 1px solid #e5dfd5 !important;
  border-radius: 16px !important;
  padding: 0.95rem 1.05rem !important;
  font-size: 0.91rem !important;
  line-height: 1.55 !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .message-ai {
  background: #1c2422 !important;
  color: #f1f5f9 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

#tutor-panel .message-timestamp {
  color: #64748b !important;
  font-size: 0.73rem !important;
  margin-top: 0.45rem !important;
  display: inline-block !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .message-timestamp {
  color: #94a3b8 !important;
}

/* Keep live captions accessible to screen readers without eating card height */
#tutor-panel .tutor-feedback-module {
  background: #f3efe7 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-top: 1px solid #e5dfd5 !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 0.22rem 1rem !important;
  gap: 0.5rem !important;
  min-height: 24px !important;
  max-height: 28px !important;
  flex-shrink: 0 !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .tutor-feedback-module {
  background: #19201e !important;
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

#tutor-panel .tutor-feedback-module .audio-visualizer-container {
  height: 12px !important;
  gap: 2px !important;
  flex-shrink: 0 !important;
  align-items: center !important;
}

#tutor-panel .tutor-feedback-module .visualizer-bar {
  width: 2px !important;
  max-height: 12px !important;
  background: #0f5c4d !important;
}

#tutor-panel .tutor-feedback-module .live-caption-display {
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  color: #64748b !important;
  text-shadow: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
}

#tutor-panel .tutor-quick-chips {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem 0.35rem;
  background: #fbf9f5;
  border-top: 1px solid #e5dfd5;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .tutor-quick-chips {
  background: #141918;
  border-top-color: rgba(255, 255, 255, 0.08);
}

#tutor-panel .tutor-quick-chips::-webkit-scrollbar {
  display: none;
}

#tutor-panel .tutor-chip-btn {
  background: #efece4;
  color: #1e293b;
  border: 1px solid #dcd5c7;
  border-radius: 999px;
  padding: 0.32rem 0.78rem;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .tutor-chip-btn {
  background: #1c2422;
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.12);
}

#tutor-panel .tutor-chip-btn:hover {
  border-color: #0f5c4d;
  color: #0f5c4d;
  background: #e6f0ec;
}

#tutor-panel .chat-input-bar {
  background: #fbf9f5 !important;
  backdrop-filter: none !important;
  padding: 0.5rem 1rem 0.9rem !important;
  border-top: none !important;
  flex-shrink: 0 !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .chat-input-bar {
  background: #141918 !important;
}

#tutor-panel .chat-input-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  background: #ffffff;
  border: 1px solid #ddd6c9;
  border-radius: 999px;
  padding: 0.3rem 0.35rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .chat-input-pill {
  background: #1c2422;
  border-color: rgba(255, 255, 255, 0.14);
}

#tutor-panel .chat-input-pill:focus-within {
  border-color: #0f5c4d;
  box-shadow: 0 0 0 3px rgba(15, 92, 77, 0.12);
}

#tutor-panel .chat-input-pill .btn-voice {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: #efece4 !important;
  color: #1e293b !important;
  border: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .chat-input-pill .btn-voice {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}

#tutor-panel .chat-input-pill .chat-input {
  flex: 1 !important;
  border: none !important;
  background: transparent !important;
  color: #1e293b !important;
  padding: 0.4rem 0.35rem !important;
  font-size: 0.91rem !important;
  outline: none !important;
  box-shadow: none !important;
}

body:not(.theme-light):not(.theme-high-contrast):not(.theme-hc) #tutor-panel .chat-input-pill .chat-input {
  color: #f8fafc !important;
}

#tutor-panel .chat-input-pill #btn-chat-send {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: #0f5c4d !important;
  color: #ffffff !important;
  border: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

#tutor-panel .chat-input-pill #btn-chat-send:hover {
  background: #0a4237 !important;
}

/* =========================================================
   Novel App Reader Mode (Library Books)
   ========================================================= */
.novel-progress-track {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.novel-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.novel-book-header {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  margin-bottom: 1rem;
}

.novel-book-cover {
  width: 68px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  flex-shrink: 0;
  background: var(--bg-card);
}

.novel-book-meta-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.novel-reading-stats {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.novel-reader-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.novel-toolbar-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.novel-tool-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.novel-tool-btn:hover {
  color: var(--text-primary);
}

.novel-tool-btn.active {
  background: var(--accent-color);
  color: #ffffff;
}

#btn-novel-font-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.novel-tool-btn-accent {
  background: var(--accent-secondary) !important;
  color: #0f172a !important;
  font-weight: 700;
}

#lesson-active-container.novel-reader-mode {
  width: 100% !important;
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 2rem 2.25rem !important;
}

.novel-reader-mode .lesson-image-wrapper,
.novel-reader-mode .lesson-visual-descriptor {
  display: none !important;
}

.novel-reader-mode .welcome-title {
  font-family: 'Fraunces', Georgia, serif;
  text-align: center;
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  margin: 0.25rem 0 0.75rem;
}

#lesson-active-container.novel-reader-mode #active-lesson-content {
  box-sizing: border-box !important;
  max-width: 100% !important;
  width: 100% !important;
  height: clamp(500px, 70vh, 780px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  white-space: normal !important;
  margin: 0.5rem auto 0 !important;
  padding: 2.5rem 3.25rem !important;
  background: #181b20 !important;
  color: #f1f5f9 !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.1) !important;
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--novel-font-size, 1.14rem) !important;
  line-height: 1.88 !important;
  letter-spacing: 0.005em;
  overflow-wrap: anywhere !important;
  word-wrap: break-word !important;
}

body.theme-light #lesson-active-container.novel-reader-mode #active-lesson-content {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
}

#lesson-active-container.novel-reader-mode #active-lesson-content::-webkit-scrollbar {
  width: 8px;
}

#lesson-active-container.novel-reader-mode #active-lesson-content::-webkit-scrollbar-track {
  background: transparent;
}

#lesson-active-container.novel-reader-mode #active-lesson-content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

#lesson-active-container.novel-reader-mode.novel-font-sans #active-lesson-content {
  font-family: var(--font-main, 'Plus Jakarta Sans', sans-serif) !important;
}

#lesson-active-container.novel-reader-mode[data-novel-theme="sepia"] #active-lesson-content,
body.theme-light #lesson-active-container.novel-reader-mode[data-novel-theme="sepia"] #active-lesson-content {
  background: #f6efe2 !important;
  color: #3b2f24 !important;
  border-color: #e4d7c1 !important;
}

#lesson-active-container.novel-reader-mode[data-novel-theme="night"] #active-lesson-content,
body.theme-light #lesson-active-container.novel-reader-mode[data-novel-theme="night"] #active-lesson-content {
  background: #13161b !important;
  color: #e2e8f0 !important;
  border-color: #262c36 !important;
}

#lesson-active-container.novel-reader-mode #active-lesson-content p.novel-para {
  margin: 0 0 1.25em !important;
  padding: 0 0.25rem !important;
  text-align: left;
  color: inherit !important;
  max-width: 100% !important;
}

#lesson-active-container.novel-reader-mode #active-lesson-content h4.novel-chapter-heading {
  font-family: 'Fraunces', Georgia, serif;
  text-align: center;
  font-size: 1.28em;
  font-weight: 700;
  margin: 0.5rem 0 1.5rem;
  letter-spacing: 0.02em;
  color: inherit !important;
}

@media (max-width: 768px) {
  #lesson-active-container.novel-reader-mode {
    padding: 1.15rem 0.9rem !important;
    gap: 1rem !important;
  }

  .novel-book-header {
    padding: 0.85rem 1rem;
    gap: 0.85rem;
  }

  .novel-book-cover {
    width: 54px;
    height: 80px;
  }

  #lesson-active-container.novel-reader-mode #active-lesson-content {
    height: clamp(360px, 60vh, 520px) !important;
    padding: 1.5rem 1.4rem !important;
    border-radius: 12px !important;
  }
}

/* Completely hide AI Tutor Card & FAB on the Login Interface or when minimized */
body.login-view-active #tutor-panel,
body.login-view-active .tutor-panel,
body.login-view-active #fab-tutor,
#tutor-panel.hidden,
#tutor-panel.hidden-floating,
.tutor-panel.hidden,
.tutor-panel.hidden-floating {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ============================================================================
   DISABILITY SIGN-UP SELECTOR & 5 ADAPTIVE DISABILITY WORKSPACE PAGES
   ============================================================================ */
.reg-disability-picker {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
}

.reg-disability-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.15rem;
}

.reg-disability-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.reg-disability-active-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.theme-light .reg-disability-active-tag {
  background: rgba(15, 92, 77, 0.1);
  color: #0f5c4d;
  border-color: rgba(15, 92, 77, 0.25);
}

.reg-disability-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  width: 100%;
}

.reg-dis-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 0.72rem 0.9rem;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

.theme-light .reg-dis-card {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.reg-dis-card:hover {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.theme-light .reg-dis-card:hover {
  border-color: rgba(15, 92, 77, 0.4);
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.reg-dis-card.active {
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(15, 92, 77, 0.09));
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.theme-light .reg-dis-card.active {
  border-color: #0f5c4d;
  background: linear-gradient(135deg, rgba(15, 92, 77, 0.1), rgba(16, 185, 129, 0.06));
  box-shadow: 0 6px 18px rgba(15, 92, 77, 0.1);
}

.reg-dis-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  transition: background 0.2s ease, color 0.2s ease;
}

.theme-light .reg-dis-icon {
  background: rgba(15, 23, 42, 0.05);
  color: #475569;
}

.reg-dis-card.active .reg-dis-icon {
  background: #10b981;
  color: #041f18;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.32);
}

.theme-light .reg-dis-card.active .reg-dis-icon {
  background: #0f5c4d;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 92, 77, 0.25);
}

.reg-dis-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.reg-dis-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.reg-dis-desc {
  font-size: 0.77rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.reg-dis-check {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  color: transparent;
  transition: all 0.2s ease;
}

.theme-light .reg-dis-check {
  border-color: rgba(15, 23, 42, 0.18);
}

.reg-dis-card.active .reg-dis-check {
  background: #10b981;
  border-color: #10b981;
  color: #041f18;
  transform: scale(1.04);
}

.theme-light .reg-dis-card.active .reg-dis-check {
  background: #0f5c4d;
  border-color: #0f5c4d;
  color: #ffffff;
}

.reg-disability-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Active Workspace Mode Pill */
.active-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--accent-color);
  background: rgba(15, 92, 77, 0.12);
  color: var(--accent-color);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.active-mode-pill:hover {
  transform: translateY(-1px);
  background: rgba(15, 92, 77, 0.2);
  box-shadow: 0 6px 16px rgba(15, 92, 77, 0.14);
}

/* Disability Workspace Hub Container */
.disability-workspace-hub {
  margin-bottom: 1.85rem;
}

.disability-page-card {
  border-radius: 22px;
  padding: 1.75rem 2rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dpage-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.dpage-kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-color);
  background: rgba(15, 92, 77, 0.12);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}

.dpage-title {
  margin: 0 0 0.35rem 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.dpage-desc {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 66ch;
  line-height: 1.6;
}

.dpage-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* 1. Normal Page */
.dpage-normal {
  background: linear-gradient(135deg, rgba(15, 92, 77, 0.06), var(--bg-card) 60%);
  border: 1px solid rgba(15, 92, 77, 0.22);
}

/* 2. Blind (Full-Presence Voice-Only Conversation Room) */
body.mode-blind #standard-welcome-banner,
body.mode-blind #modules-list,
body.mode-blind #fab-tutor,
body.mode-blind #voice-command-hud {
  display: none !important;
}

body.mode-blind .dashboard-panel {
  gap: 0;
}

body.mode-blind .disability-workspace-hub {
  margin-bottom: 0;
}

.dpage-blind {
  width: 100%;
  max-width: 820px;
  min-height: calc(100vh - 132px);
  margin: 0 auto;
  background: radial-gradient(circle at 50% 12%, rgba(16, 185, 129, 0.16) 0%, #0b1110 46%, #070a09 100%) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 30px !important;
  padding: 2.4rem 2.2rem 1.75rem !important;
  box-shadow: 0 32px 72px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex !important;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem !important;
}

.blind-voice-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  padding: 0.75rem 0 0.25rem;
}

.blind-voice-orb {
  --orb-voice-scale: 1;
  position: relative;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s ease;
}

.blind-voice-orb:hover {
  transform: scale(1.04);
}

.blind-orb-halo {
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.36) 0%, rgba(16, 185, 129, 0) 70%);
  filter: blur(12px);
  transform: scale(var(--orb-voice-scale));
  transition: opacity 0.35s ease, transform 0.1s ease-out;
}

.blind-voice-orb.is-paused .blind-orb-halo {
  opacity: 0.12;
}

.blind-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(52, 211, 153, 0.45);
  opacity: 0;
}

.blind-voice-orb.is-listening .blind-orb-ring-1 {
  animation: blindOrbPulse 2.8s ease-out infinite;
}

.blind-voice-orb.is-listening .blind-orb-ring-2 {
  animation: blindOrbPulse 2.8s ease-out 1.4s infinite;
}

.blind-voice-orb.is-speaking .blind-orb-ring-1 {
  border-color: rgba(110, 231, 183, 0.78);
  animation: blindOrbPulse 1.3s ease-out infinite;
}

.blind-voice-orb.is-speaking .blind-orb-ring-2 {
  border-color: rgba(52, 211, 153, 0.5);
  animation: blindOrbPulse 1.3s ease-out 0.65s infinite;
}

.blind-voice-orb.is-thinking .blind-orb-ring-1 {
  border-color: rgba(148, 163, 184, 0.68);
  animation: blindOrbPulse 1.4s ease-in-out infinite;
}

@keyframes blindOrbPulse {
  0% { transform: scale(0.84); opacity: 0.72; }
  100% { transform: scale(1.58); opacity: 0; }
}

.blind-orb-core {
  position: relative;
  z-index: 2;
  width: 102px;
  height: 102px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #6ee7b7 0%, #10b981 48%, #0f5c4d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(calc(0.96 + (var(--orb-voice-scale) - 1) * 0.35));
  box-shadow: 0 16px 40px rgba(16, 185, 129, 0.4), inset 0 2px 8px rgba(255, 255, 255, 0.36);
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.1s ease-out;
}

.blind-voice-orb.is-speaking .blind-orb-core {
  background: radial-gradient(circle at 32% 28%, #a7f3d0 0%, #34d399 44%, #059669 100%);
  box-shadow: 0 0 48px rgba(52, 211, 153, 0.62), inset 0 2px 10px rgba(255, 255, 255, 0.48);
}

.blind-voice-orb.is-thinking .blind-orb-core {
  background: radial-gradient(circle at 32% 28%, #99f6e4 0%, #0d9488 55%, #115e59 100%);
  box-shadow: 0 12px 32px rgba(13, 148, 136, 0.44);
}

.blind-voice-orb.is-paused .blind-orb-core {
  background: radial-gradient(circle at 32% 28%, #475569 0%, #1e293b 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42), inset 0 1px 2px rgba(255, 255, 255, 0.14);
}

.blind-wave-bars {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
}

.blind-wave-bars span {
  width: 4.5px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  transition: height 0.18s ease;
}

.blind-voice-orb.is-paused .blind-wave-bars span {
  height: 6px;
  background: rgba(255, 255, 255, 0.42);
}

.blind-voice-orb.is-listening .blind-wave-bars span {
  animation: blindWaveIdle 1.65s ease-in-out infinite;
}

.blind-voice-orb.is-speaking .blind-wave-bars span {
  animation: blindWaveActive 0.58s ease-in-out infinite;
}

.blind-voice-orb.is-thinking .blind-wave-bars span {
  animation: blindWaveThink 0.92s ease-in-out infinite;
}

.blind-wave-bars span:nth-child(2) { animation-delay: 0.11s; }
.blind-wave-bars span:nth-child(3) { animation-delay: 0.22s; }
.blind-wave-bars span:nth-child(4) { animation-delay: 0.33s; }
.blind-wave-bars span:nth-child(5) { animation-delay: 0.44s; }

@keyframes blindWaveIdle {
  0%, 100% { height: 8px; }
  50% { height: 20px; }
}

@keyframes blindWaveActive {
  0%, 100% { height: 8px; }
  50% { height: 34px; }
}

@keyframes blindWaveThink {
  0%, 100% { height: 7px; opacity: 0.42; }
  50% { height: 14px; opacity: 1; }
}

.blind-stage-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  max-width: 600px;
}

.blind-convo-status {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.blind-interim-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.5;
  min-height: 1.45em;
}

.blind-interim-text.is-hearing {
  color: #a7f3d0;
}

/* Editorial Live Voice Transcript (Softly Faded, Uncluttered) */
.blind-convo-feed {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  padding: 1.35rem 1.25rem 0.75rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid rgba(255, 255, 255, 0.05);
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.blind-convo-feed::-webkit-scrollbar {
  width: 6px;
}

.blind-convo-feed::-webkit-scrollbar-track {
  background: transparent;
}

.blind-convo-feed::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.blind-convo-feed::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.blind-turn {
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  max-width: 84%;
  padding: 0.92rem 1.2rem;
  border-radius: 20px;
  line-height: 1.62;
  animation: blindTurnIn 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes blindTurnIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.blind-turn-ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-bottom-left-radius: 6px;
  color: #f1f5f9;
}

.blind-turn-user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(15, 92, 77, 0.32));
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-bottom-right-radius: 6px;
  color: #ffffff;
}

.blind-turn-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.blind-turn-ai .blind-turn-meta {
  color: #34d399;
}

.blind-turn-user .blind-turn-meta {
  color: #a7f3d0;
}

.blind-turn-body {
  font-size: 1rem;
  font-weight: 450;
  word-wrap: break-word;
}

.blind-turn-body p {
  margin: 0 0 0.45rem 0;
}

.blind-turn-body p:last-child {
  margin-bottom: 0;
}

.blind-turn-user .blind-turn-body {
  font-weight: 500;
}

.blind-turn-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  margin-top: 0.35rem;
  padding: 0.2rem 0.68rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.24);
}

/* Minimal Hands-Free Bottom Dock */
.blind-bottom-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.blind-keyboard-drawer {
  width: 100%;
  max-width: 580px;
}

.blind-dock-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.blind-dock-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.blind-dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.64rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.14s ease;
}

.blind-dock-btn:hover,
.blind-dock-btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  transform: translateY(-1px);
  outline: none;
}

.blind-dock-mic {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.42);
  color: #6ee7b7;
}

.blind-dock-subtle {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.07);
  color: #94a3b8;
}

.blind-shortcut-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  font-size: 0.76rem;
  color: #64748b;
  letter-spacing: 0.01em;
}

.blind-shortcut-strip span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.blind-shortcut-strip kbd {
  padding: 0.14rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
}

.blind-pill-composer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.38rem 0.32rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.blind-pill-composer:focus-within {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(255, 255, 255, 0.08);
}

.blind-convo-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #f8fafc;
  font-size: 0.93rem;
  outline: none;
  padding: 0.44rem 0;
}

.blind-convo-input::placeholder {
  color: #64748b;
}

.blind-send-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #10b981;
  color: #041f18;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.14s ease;
}

.blind-send-circle:hover {
  background: #34d399;
  transform: scale(1.05);
}

/* Compact Floating Voice Bar when Blind User Opens a Lesson/Library/Quiz */
.blind-floating-voice-bar {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 980;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 0.7rem 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(11, 17, 16, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
  color: #f8fafc;
  max-width: calc(100vw - 2rem);
}

.blind-float-orb-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.25rem;
}

.blind-float-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.85);
  flex-shrink: 0;
}

.blind-float-dot.is-speaking {
  background: #6ee7b7;
  animation: blindOrbPulse 1.2s ease-out infinite;
}

.blind-float-dot.is-thinking {
  background: #38bdf8;
}

.blind-float-dot.is-paused {
  background: #64748b;
  box-shadow: none;
}

.blind-float-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.blind-float-pill {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease;
}

.blind-float-pill:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #ffffff;
}

/* 3. Visually Impaired (High-Contrast Magnified Page) */
.dpage-vi {
  border: 2.5px solid var(--accent-color) !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.vi-controls-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding-top: 0.85rem;
  border-top: 1.5px solid var(--border-color);
}

.vi-control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.vi-control-label {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

.vi-scale-readout {
  font-size: 1rem;
  font-weight: 800;
  min-width: 54px;
  text-align: center;
  color: var(--accent-color);
}

.vi-big-btn {
  padding: 0.62rem 1.08rem;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.vi-big-btn:hover,
.vi-big-btn:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent-color);
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

.vi-big-btn-primary {
  background: var(--accent-color);
  color: #000000 !important;
  border-color: var(--accent-color);
}

/* 4. Dumb (Non-Verbal / Speech-Impaired Type-to-Speak Page) */
.dpage-dumb {
  border: 1.5px solid rgba(15, 92, 77, 0.35);
  background: linear-gradient(135deg, rgba(15, 92, 77, 0.08), var(--bg-card) 65%);
}

.dumb-aac-composer {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

.dumb-aac-composer input {
  flex: 1 1 280px;
  padding: 0.85rem 1.15rem !important;
  border-radius: 12px !important;
  border: 1.5px solid var(--border-color) !important;
  background: var(--bg-secondary) !important;
}

.dumb-spoken-banner {
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  background: rgba(15, 92, 77, 0.14);
  border: 1.5px solid var(--accent-color);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.96rem;
}

.dumb-phrase-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.dumb-phrase-chip {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.dumb-phrase-chip:hover {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: #ffffff;
  transform: translateY(-1px);
}

/* 5. Deaf (Visual-First & Persistent Silent Live Caption Bar) */
.deaf-live-caption-bar {
  position: sticky;
  top: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: #0f172a;
  color: #f8fafc;
  border-bottom: 3px solid #38bdf8;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
}

.deaf-live-caption-bar.visual-alert-flash {
  animation: deafFlashPulse 0.9s ease 2;
}

@keyframes deafFlashPulse {
  0%, 100% { background: #0f172a; border-bottom-color: #38bdf8; }
  50% { background: #0c4a6e; border-bottom-color: #fde047; }
}

.deaf-caption-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #38bdf8;
  flex-shrink: 0;
}

.deaf-caption-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.deaf-live-caption-text {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: #ffffff;
}

.deaf-visual-alert-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.24rem 0.7rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #bae6fd;
  flex-shrink: 0;
}

.dpage-deaf {
  border: 1.5px solid rgba(2, 132, 199, 0.4);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), var(--bg-card) 65%);
}

.dpage-deaf .dpage-kicker {
  background: rgba(14, 165, 233, 0.14);
  color: #0284c7;
}

.deaf-feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.deaf-feature-pill {
  padding: 0.8rem 1rem;
  border-radius: 13px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.45;
}

/* Body-level Disability Mode Adaptations */
body.mode-blind #modules-list > div {
  width: 100% !important;
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

body.mode-blind *:focus-visible {
  outline: 2px solid #34d399 !important;
  outline-offset: 2px !important;
}

body.mode-visually-impaired *:focus-visible {
  outline: 3px solid #ffe600 !important;
  outline-offset: 3px !important;
}

body.mode-visually-impaired .learner-card,
body.mode-visually-impaired .auth-card {
  border-width: 2.5px !important;
}

body.mode-dumb #btn-mic-input,
body.mode-dumb #btn-voice-nav,
body.mode-dumb #voice-command-hud {
  display: none !important;
}

body.mode-deaf #btn-voice-nav,
body.mode-deaf #voice-command-hud,
body.mode-deaf #btn-read-lesson,
body.mode-deaf #btn-pause-lesson,
body.mode-deaf #btn-stop-lesson {
  opacity: 0.55;
}

body.mode-deaf #visual-cue-module {
  display: flex !important;
}

/* Admin Accommodation Badges for New Disability Profiles */
.acc-blind {
  background: rgba(250, 204, 21, 0.18);
  color: #eab308;
  border: 1px solid rgba(250, 204, 21, 0.45);
}

.acc-dumb {
  background: rgba(16, 185, 129, 0.16);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.acc-deaf {
  background: rgba(14, 165, 233, 0.16);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

@media (max-width: 768px) {
  .blind-action-grid,
  .deaf-feature-strip {
    grid-template-columns: 1fr;
  }
  .deaf-live-caption-bar {
    flex-wrap: wrap;
    padding: 0.65rem 1rem;
  }
}




