/* AI Project Universe V6.13 — compact mobile bottom boundary
   Removes artificial empty scroll tails from Student Performance and AI Architect Lab
   while keeping desktop/laptop layouts unchanged. */

@media (max-width: 820px) {
  /* Student Performance: content height must end shortly after the real footer. */
  html[data-scroll-theme="student-performance"],
  html[data-scroll-theme="student-performance"] body {
    min-height: 0 !important;
    height: auto !important;
    padding-bottom: 0 !important;
    overscroll-behavior-y: none !important;
  }

  html[data-scroll-theme="student-performance"] .sp-app,
  html[data-scroll-theme="student-performance"] .sp-main,
  html[data-scroll-theme="student-performance"] .sp-view.is-active {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
  }

  html[data-scroll-theme="student-performance"] .sp-main {
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }

  html[data-scroll-theme="student-performance"] .sp-footer {
    margin-top: 18px !important;
    padding: 18px 0 8px !important;
  }

  html[data-scroll-theme="student-performance"] .sp-scroll-end {
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 12px 0 max(8px, env(safe-area-inset-bottom)) !important;
    place-items: start center !important;
  }
}

@media (max-width: 767px) {
  /* AI Architect Lab: disable the min-screen/flex filler below the real footer. */
  html[data-scroll-theme="ai-architect"],
  html[data-scroll-theme="ai-architect"] body,
  html[data-scroll-theme="ai-architect"] #root,
  html[data-scroll-theme="ai-architect"] #root > div {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    overscroll-behavior-y: none !important;
  }

  html[data-scroll-theme="ai-architect"] #root > div > div.flex.flex-1.overflow-hidden {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html[data-scroll-theme="ai-architect"] .ai-architect-main,
  html[data-scroll-theme="ai-architect"] main {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    overflow: visible !important;
  }

  html[data-scroll-theme="ai-architect"] main > footer,
  html[data-scroll-theme="ai-architect"] footer {
    margin-bottom: 0 !important;
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }

  html[data-scroll-theme="ai-architect"] #root::after,
  html[data-scroll-theme="ai-architect"] body::after {
    margin: 0 !important;
    padding: 0 !important;
  }
}
