/* Sprint 11G + 11H — multi-subject learner shell and containment hardening */

body[data-student-page="home"].amp-multisubject-ready #dashboardLoading,
body[data-student-page="home"].amp-multisubject-ready #dashboardContent,
body[data-student-page="home"].amp-multisubject-ready #modeMessage,
body[data-student-page="home"].amp-multisubject-ready #noCoursesPanel {
  display: none !important;
}

.amp-multisubject-home {
  display: grid;
  gap: var(--amp-space-5);
  min-width: 0;
  max-width: 100%;
}

.amp-global-next {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: var(--amp-space-4);
  align-items: center;
  min-width: 0;
  max-width: 100%;
  padding: var(--amp-space-5);
  border-left: 4px solid var(--amp-color-primary);
}

.amp-global-next > * {
  min-width: 0;
  max-width: 100%;
}

.amp-global-next h3 {
  margin: .25rem 0 .35rem;
  font-size: var(--amp-font-size-xl);
}

.amp-global-next .button-link {
  justify-self: end;
  width: fit-content;
  max-width: min(100%, 22rem);
}

.amp-global-next-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .7rem;
  min-width: 0;
}

.amp-course-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: .25rem .65rem;
  border-radius: var(--amp-radius-pill);
  background: var(--amp-color-primary-soft);
  color: var(--amp-color-primary);
  font-size: var(--amp-font-size-xs);
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.amp-subjects-heading,
.amp-attention-heading {
  display: flex;
  justify-content: space-between;
  gap: var(--amp-space-4);
  align-items: end;
  margin-bottom: var(--amp-space-3);
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}

.amp-subjects-heading > *,
.amp-attention-heading > * {
  min-width: 0;
  max-width: 100%;
}

.amp-subjects-heading h2,
.amp-attention-heading h2 {
  margin: .2rem 0 0;
}

.amp-subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(260px,100%),1fr));
  gap: var(--amp-space-4);
  min-width: 0;
  max-width: 100%;
}

.amp-subject-card {
  display: grid;
  gap: var(--amp-space-3);
  min-width: 0;
  max-width: 100%;
  padding: var(--amp-space-5);
  overflow: hidden;
}

.amp-subject-card > * {
  min-width: 0;
  max-width: 100%;
}

.amp-subject-card-head {
  display: flex;
  justify-content: space-between;
  gap: var(--amp-space-3);
  align-items: start;
  min-width: 0;
}

.amp-subject-card-head > div {
  min-width: 0;
  max-width: 100%;
}

.amp-subject-card h3 {
  margin: .1rem 0 0;
  font-size: var(--amp-font-size-xl);
}

.amp-subject-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--amp-color-primary-soft);
  color: var(--amp-color-primary);
  font-weight: 900;
}

.amp-subject-stats {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: var(--amp-space-2);
  min-width: 0;
}

.amp-subject-stat {
  min-width: 0;
  padding: .8rem;
  border-radius: var(--amp-radius-sm);
  background: var(--amp-color-bg-subtle);
}

.amp-subject-stat span,
.amp-subject-stat strong {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.amp-subject-stat span {
  color: var(--amp-color-text-muted);
  font-size: var(--amp-font-size-xs);
}

.amp-subject-stat strong {
  margin-top: .2rem;
  line-height: 1.35;
}

.amp-subject-class-list {
  display: grid;
  gap: .2rem;
  min-width: 0;
  max-width: 100%;
  color: var(--amp-color-text-muted);
  font-size: var(--amp-font-size-sm);
}

.amp-subject-class-list span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.amp-subject-card .button-link {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
}

.amp-attention-list {
  display: grid;
  gap: var(--amp-space-2);
  min-width: 0;
}

.amp-attention-item {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: var(--amp-space-3);
  align-items: start;
  min-width: 0;
  max-width: 100%;
  padding: var(--amp-space-3);
  border: 1px solid var(--amp-color-border);
  border-radius: var(--amp-radius-md);
  background: var(--amp-color-surface);
}

.amp-attention-item > * {
  min-width: 0;
  max-width: 100%;
}

.amp-attention-item strong,
.amp-attention-item span {
  display: block;
  overflow-wrap: anywhere;
}

.amp-attention-item span {
  margin-top: .15rem;
  color: var(--amp-color-text-muted);
  font-size: var(--amp-font-size-sm);
}

.amp-no-courses {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: var(--amp-space-4);
  align-items: center;
  min-width: 0;
  max-width: 100%;
  padding: var(--amp-space-5);
}

.amp-no-courses > * {
  min-width: 0;
  max-width: 100%;
}

.amp-course-shell {
  display: grid;
  gap: var(--amp-space-5);
  min-width: 0;
  max-width: 100%;
}

.amp-course-placeholder {
  min-width: 0;
  max-width: 100%;
  padding: var(--amp-space-5);
  border-left: 4px solid var(--amp-color-primary);
  overflow: hidden;
}

.amp-course-placeholder > * {
  min-width: 0;
  max-width: 100%;
}

.amp-course-placeholder h2 {
  margin: .25rem 0 .45rem;
}

@media (max-width: 760px) {
  .amp-global-next,
  .amp-no-courses {
    grid-template-columns: 1fr;
    padding: var(--amp-space-4);
  }
  .amp-global-next .button-link,
  .amp-no-courses .button-link,
  .amp-subject-card .button-link {
    justify-self: stretch;
    width: 100%;
  }
  .amp-subject-grid {
    grid-template-columns: 1fr;
  }
  .amp-subject-card,
  .amp-course-placeholder {
    padding: var(--amp-space-4);
  }
  .amp-subject-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .amp-subject-stats {
    grid-template-columns: 1fr;
  }
  .amp-subject-card-head {
    align-items: center;
  }
}

#courseContent { display: grid; gap: var(--amp-space-4); min-width: 0; }
#courseContent .amp-subject-grid { align-items: stretch; }
#courseContent .card { padding: var(--amp-space-5); }
#courseContent details, #analyticsEvidenceGroups details, .school-detail details { overflow-wrap: anywhere; }
#courseContent td, #analyticsEvidenceGroups dd { overflow-wrap: anywhere; }
#learningPlayer .option { display: flex; gap: .75rem; padding: .75rem; }
#learningPlayer fieldset { display: grid; gap: .5rem; border: 0; }
#learningPlayer [data-help-content] { white-space: pre-line; }
#learningPlayer button { margin: .5rem; }
