img,
iframe {
  max-width: 100%;
}

body {
  min-width: 320px;
}

body[data-portal="student"] {
  background:
    radial-gradient(ellipse at 8% 14%, #dcecff 0, transparent 32%),
    radial-gradient(ellipse at 92% 36%, #e5f8ed 0, transparent 28%),
    linear-gradient(145deg, #f3f7ff, #f8fbff 48%, #f2f8f5);
}

.portal-content,
.landing-main,
.activity-wrap,
.practice-wrap {
  width: 100%;
}

.student-learning-page {
  max-width: 1280px;
}

.student-learning-page .portal-title {
  margin-bottom: 28px;
}

.student-learning-page .portal-title h1 {
  font-size: clamp(30px, 3.2vw, 38px);
}

.student-learning-page .portal-title p {
  font-size: 15px;
  line-height: 1.6;
}

.student-progress-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
}

.student-progress-class {
  color: #263b52;
  font-size: 15px;
  font-weight: 800;
}

.student-progress-summary .pill {
  padding: 4px 9px;
  font-size: 12px;
}

.admin-title-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.admin-school-name {
  color: #243951;
  font-size: 18px;
  font-weight: 800;
  text-align: right;
}

@media (max-width: 640px) {
  .admin-title-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .admin-school-name {
    font-size: 15px;
    text-align: left;
  }
}

.student-language-toggle {
  display: inline-flex;
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  border-radius: 999px;
  background: #e6e6e8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.student-header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.student-school-name {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #243951;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.student-language-toggle button {
  min-width: 70px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #f5eadb;
  color: #5a432f;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.student-language-toggle button[aria-pressed="true"] {
  background: #f38e6a;
  color: #fff;
  box-shadow: 0 3px 8px rgba(243,142,106,0.35);
}

.student-language-toggle button:focus-visible {
  outline: 3px solid #315fe8;
  outline-offset: 3px;
}

.portal-language-toggle {
  margin: 0;
  padding: 3px;
}

.portal-language-toggle button {
  min-width: 48px;
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.student-learning-panel {
  padding: clamp(18px, 3vw, 32px);
  border-color: #dfe8f5;
  border-radius: 22px;
  background: linear-gradient(145deg, #ffffffed, #fafdffed);
  box-shadow: 0 20px 60px #27466d12;
}

.student-subject-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.student-subject-heading > div {
  min-width: 0;
}

.student-subject-heading label {
  display: block;
  color: #243951;
  font-size: 19px;
  font-weight: 800;
}

.student-subject-heading p {
  margin: 5px 0 0;
  color: #687b91;
  font-size: 14px;
}

.curriculum-browser {
  margin-bottom: 18px;
}

.admin-collapsible-panel > .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-section-toggle {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid #d8e2ef;
  border-radius: 10px;
  background: #f7f9fc;
  color: #263b52;
  cursor: pointer;
  font-size: 25px;
  font-weight: 600;
  line-height: 1;
}

.admin-section-toggle:hover,
.admin-section-toggle:focus-visible {
  border-color: #315fe8;
  outline: 2px solid #315fe833;
  outline-offset: 2px;
}

.admin-panel-content[hidden] {
  display: none;
}

.teacher-assignment-fields {
  display: grid;
  gap: 16px;
  margin: 18px 0;
}

.teacher-assignment-group {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid #e2e9f3;
  border-radius: 12px;
}

.teacher-assignment-group legend {
  padding: 0 6px;
  color: #263b52;
  font-weight: 700;
}

.teacher-assignment-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 14px;
}

.teacher-assignment-options label {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  color: #42566d;
}

.teacher-assignment-options input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #315fe8;
}

.portal-content .teacher-name-pill {
  padding: 8px 14px;
  font-size: 18px;
}

.teacher-curriculum-browser {
  padding: 0;
  overflow: hidden;
}

.teacher-curriculum-browser > summary,
.teacher-curriculum-chapter > summary,
.teacher-curriculum-question-types > summary,
.teacher-dashboard-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  cursor: pointer;
  list-style: none;
}

.teacher-curriculum-browser > summary::-webkit-details-marker,
.teacher-curriculum-chapter > summary::-webkit-details-marker,
.teacher-curriculum-question-types > summary::-webkit-details-marker,
.teacher-dashboard-section > summary::-webkit-details-marker {
  display: none;
}

.teacher-curriculum-browser > summary > span:first-child {
  display: grid;
  gap: 4px;
}

.teacher-curriculum-browser > summary strong,
.teacher-dashboard-section > summary strong {
  color: #263b52;
  font-size: 18px;
}

.teacher-curriculum-browser > summary small,
.teacher-dashboard-section > summary small {
  color: #687b91;
  font-size: 14px;
}

.teacher-curriculum-toggle {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid #d8e2ef;
  border-radius: 10px;
  background: #f7f9fc;
  color: #263b52;
  font-size: 25px;
  font-weight: 600;
  line-height: 1;
}

.teacher-curriculum-toggle::before {
  content: "+";
}

details[open] > summary .teacher-curriculum-toggle::before {
  content: "−";
}

.teacher-curriculum-browser > summary:focus-visible,
.teacher-curriculum-chapter > summary:focus-visible,
.teacher-curriculum-question-types > summary:focus-visible,
.teacher-dashboard-section > summary:focus-visible {
  outline: 3px solid #9bb2ff;
  outline-offset: -3px;
}

.teacher-dashboard-section {
  padding: 0;
  overflow: hidden;
}

.teacher-dashboard-section-content {
  padding: 0 18px 18px;
}

.teacher-curriculum-content {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.teacher-curriculum-chapter {
  border: 1px solid #e2e9f3;
  border-radius: 12px;
  background: #fff;
}

.teacher-curriculum-chapter > summary {
  min-height: 54px;
  padding: 10px 14px;
  color: #263b52;
  font-weight: 700;
}

.teacher-curriculum-chapter > .teacher-curriculum-subtopics {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0 18px 16px 40px;
  color: #42566d;
}

.teacher-curriculum-subtopic {
  display: grid;
  gap: 6px;
}

.teacher-curriculum-question-types {
  border: 1px solid #edf0f5;
  border-radius: 9px;
  background: #fbfcfe;
}

.teacher-curriculum-question-types > summary {
  min-height: 38px;
  padding: 5px 9px;
  color: #465d76;
  font-size: 13px;
  font-weight: 600;
}

.teacher-curriculum-question-types .teacher-curriculum-toggle {
  width: 27px;
  height: 27px;
  flex-basis: 27px;
  border-radius: 8px;
  font-size: 20px;
}

.teacher-curriculum-question-types > ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 4px 12px 12px 28px;
  color: #42566d;
  font-size: 13px;
}

.teacher-curriculum-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.teacher-curriculum-levels .pill {
  padding: 3px 8px;
  font-size: 11px;
}

.teacher-practice-level {
  border: 1px solid #b8c8f7;
  color: #234cbb;
  font-weight: 700;
  text-decoration: none;
}

.teacher-practice-level:hover,
.teacher-practice-level:focus-visible {
  background: #e9efff;
}

.teacher-practice-level-unavailable {
  opacity: 0.55;
}

.teacher-practice-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.teacher-achievement-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.teacher-achievement {
  padding: 14px;
  border: 1px solid #e3eaf3;
  border-radius: 12px;
  background: #fff;
}

.teacher-achievement p {
  margin: 8px 0 0;
  color: #52657a;
}

.teacher-curriculum-chapter > p {
  margin: 0;
  padding: 0 16px 16px;
}

.curriculum-browser-filters {
  max-width: 680px;
  margin-bottom: 20px;
}

.curriculum-browser-chapters {
  display: grid;
  gap: 12px;
}

.curriculum-browser-chapter {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.curriculum-browser-chapter > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.curriculum-browser-chapter > summary::-webkit-details-marker {
  display: none;
}

.curriculum-browser-chapter > summary:focus-visible {
  outline: 3px solid #9bb2ff;
  outline-offset: -3px;
}

.curriculum-browser-chapter > summary .panel-head {
  margin: 0;
}

.curriculum-browser-chapter h3 {
  margin: 5px 0 0;
}

.curriculum-browser-subtopics {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 18px 18px 40px;
  color: #42566d;
}

.curriculum-browser-subtopics li {
  padding-left: 3px;
}

.curriculum-browser-subtopic {
  display: grid;
  gap: 8px;
}

.curriculum-browser-question-types {
  padding: 10px 12px;
  border: 1px solid #edf0f5;
  border-radius: 9px;
  background: #fbfcfe;
  color: #465d76;
  font-size: 13px;
}

.curriculum-browser-question-types > ul {
  display: grid;
  gap: 10px;
  margin: 8px 0 0;
  padding-left: 20px;
}

.curriculum-browser-question-types > ul > li > strong {
  color: #263b52;
}

.student-subject-links {
  display: grid;
  grid-template-columns: repeat(var(--student-subject-columns, 6), minmax(0, 1fr));
  gap: 12px;
}

.student-subject-link {
  display: flex;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid #e2e9f3;
  border-left: 5px solid #00aeca;
  border-radius: 16px;
  background: #fff;
  color: #263b52;
  cursor: default;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.student-subject-link:hover {
  transform: translateY(-2px);
  border-color: #c8d7ef;
  box-shadow: 0 9px 22px #27466d14;
}

.student-subject-link:focus-visible {
  outline: 3px solid #9bb2ff;
  outline-offset: 3px;
}

.student-subject-link[aria-pressed="true"] {
  border-color: var(--student-subject-accent, #315fe8);
  border-left-width: 5px;
  border-left-color: var(--student-subject-accent, #315fe8);
  background: color-mix(in srgb, var(--student-subject-accent, #315fe8) 8%, white);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--student-subject-accent, #315fe8) 12%, transparent);
}

.student-subject-link:nth-child(6n + 2) { border-left-color: #ff9518; }
.student-subject-link:nth-child(6n + 3) { border-left-color: #72c72b; }
.student-subject-link:nth-child(6n + 4) { border-left-color: #d33f27; }
.student-subject-link:nth-child(6n + 5) { border-left-color: #8728bb; }
.student-subject-link:nth-child(6n) { border-left-color: #00ae74; }

.student-learning-page[data-subject-style="link"] .student-subject-link {
  border-top-color: transparent;
  border-right-color: transparent;
  border-bottom-color: #d8e1ee;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}

.student-learning-page[data-subject-style="link"] .student-subject-link[aria-pressed="true"] {
  border-bottom-color: var(--student-subject-accent, #315fe8);
  background: color-mix(in srgb, var(--student-subject-accent, #315fe8) 8%, transparent);
}

.student-learning-page[data-subject-style="card"] .student-subject-link {
  border-left-color: var(--student-subject-accent, #315fe8);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 16px #27466d0b;
}

.student-learning-page[data-subject-style="card"] .student-subject-link[aria-pressed="true"] {
  border-color: var(--student-subject-accent, #315fe8);
  background: color-mix(in srgb, var(--student-subject-accent, #315fe8) 8%, white);
}

.student-learning-page[data-subject-style="circle"] .student-subject-link {
  min-height: 64px;
  justify-content: center;
  border: 2px solid color-mix(in srgb, var(--student-subject-accent, #315fe8) 55%, white);
  border-radius: 999px;
  background: #fff;
  color: #203550;
  text-align: center;
}

.student-learning-page[data-subject-style="circle"] .student-subject-link[aria-pressed="true"] {
  border-color: var(--student-subject-accent, #315fe8);
  background: color-mix(in srgb, var(--student-subject-accent, #315fe8) 13%, white);
}

.student-learning-page[data-subject-style] .student-subject-link[aria-pressed="true"] {
  border-color: #16834f;
  border-left-color: #16834f;
  background: #e2f5e9;
  box-shadow: inset 4px 0 #16834f, 0 4px 10px #16834f20;
  color: #14532d;
}

.student-learning-page[data-subject-style="link"] .student-subject-link[aria-pressed="true"] {
  border-top-color: transparent;
  border-right-color: transparent;
  border-bottom-color: #16834f;
  border-left-color: transparent;
  background: #e2f5e9;
  box-shadow: none;
}

.student-subject-name {
  overflow-wrap: anywhere;
  font-size: var(--student-subject-font-size, 16px);
  font-weight: 750;
  line-height: 1.25;
}

.student-language-hint {
  margin: 18px 0;
  color: #516780;
  font-size: 14px;
  line-height: 1.6;
}

.student-learning-page .award-card {
  padding: 22px;
  border-radius: 17px;
}

.student-learning-page .award-card h3 {
  font-size: 20px;
}

.student-learning-page .award-card p,
.student-learning-page .panel-head p,
.student-learning-page .lesson-practice-heading p {
  font-size: 14px;
  line-height: 1.6;
}

.student-learning-page .student-chapter-panel {
  padding: 22px;
  border-radius: 18px;
}

.student-learning-page .student-chapter-field label {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 7px;
  background: #e8efff;
  color: #254db8;
  font-weight: 800;
}

.student-learning-page .panel-head h2 {
  font-size: 21px;
}

.student-learning-page .field label {
  font-size: 13px;
}

.student-learning-page .student-chapter-field select {
  font-weight: 800;
}

.student-learning-page .field select {
  min-height: 46px;
  font-size: 15px;
}

.student-learning-page .student-chapter-panel > .panel-head h2 {
  font-weight: 800;
}

.student-learning-page .student-subtopic-grid .btn {
  min-height: 54px;
  font-size: 15px;
  line-height: 1.4;
}

.student-learning-page .student-lesson-slot {
  grid-column: 1 / -1;
  min-width: 0;
}

.student-learning-page .student-lesson-slot .lesson-learning {
  margin: 0;
  padding: 8px 12px;
  border-radius: 11px;
}

.student-learning-page .student-lesson-slot .lesson-learning[open] {
  padding: 12px;
}

.student-learning-page .student-lesson-slot .lesson-learning-heading {
  gap: 8px;
}

.student-learning-page .student-lesson-slot .lesson-step {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}

.student-learning-page .student-lesson-slot .lesson-learning-heading h3 {
  margin: 0;
  font-size: 15px;
}

.student-learning-page .student-lesson-slot .lesson-learning-heading .section-kicker {
  display: none;
}

.student-learning-page .student-subtopic-grid .btn[aria-expanded="true"] {
  border: 1px solid #16834f;
  background: #e2f5e9;
  box-shadow: inset 4px 0 #16834f, 0 4px 10px #16834f20;
  color: #14532d;
  font-weight: 800;
}

.student-learning-page .social-question-type.selected {
  border: 2px solid #16834f;
  background: #e2f5e9;
  box-shadow: inset 4px 0 #16834f, 0 4px 10px #16834f20;
  color: #14532d;
  font-weight: 800;
}

.student-learning-page .level-tile {
  padding: 16px;
}

.student-learning-page .level-tile h3 {
  font-size: 17px;
}

.student-learning-page .level-tile p {
  font-size: 13px;
  line-height: 1.5;
}

.student-learning-page .lesson-learning h3 {
  font-size: 18px;
}

.student-learning-page .lesson-content-copy {
  font-size: 17px;
}

.field,
.level-tile,
.stat-card,
.portal-card {
  min-width: 0;
}

.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select {
  max-width: 100%;
}

.student-topic-levels,
.panel,
.lesson-learning,
.lesson-studio {
  min-width: 0;
}

.social-question-type {
  overflow-wrap: anywhere;
}

.activity-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.activity-timer {
  display: inline-grid;
  min-width: 116px;
  justify-items: center;
  gap: 1px;
  padding: 7px 13px;
  border: 1px solid #526f89;
  border-radius: 14px;
  background: #17324f;
  box-shadow: 0 5px 14px #17324f2b;
  color: #fff;
  line-height: 1;
}

.activity-timer > span {
  color: #c8d9e9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.activity-timer strong {
  font-size: clamp(27px, 3vw, 34px);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: .03em;
}

@media (min-width: 901px) {
  main.student-learning-page {
    padding-top: 14px;
  }

  .student-learning-page .portal-title {
    margin-bottom: 12px;
  }

  .student-learning-page .portal-title h1 {
    font-size: 32px;
  }

  .student-learning-page .portal-title p {
    margin: 4px 0;
    line-height: 1.4;
  }

  .student-learning-page .student-language-toggle {
    margin-top: 0;
  }

  .student-learning-page .student-language-toggle button {
    min-height: 38px;
    padding: 7px 14px;
  }

  .student-learning-panel {
    padding: 7px 14px 9px;
    border-radius: 14px;
  }

  .student-subject-heading {
    gap: 4px;
    margin-bottom: 2px;
  }

  .student-subject-heading label {
    font-size: 15px;
  }

  .student-subject-heading p {
    display: none;
  }

  .student-subject-links {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1px 6px;
  }

  .student-subject-link,
  .student-learning-page[data-subject-style="circle"] .student-subject-link {
    min-height: 28px;
    justify-content: flex-start;
    padding: 3px 7px;
    border-left-width: 3px;
    border-radius: 5px;
    text-align: left;
  }

  .student-subject-name {
    font-size: 13px;
    line-height: 1.1;
  }

  .student-language-hint {
    display: none;
  }

  .student-learning-page .award-card {
    padding: 8px 12px;
    border-radius: 13px;
  }

  .student-learning-page .award-card h3 {
    margin: 0;
    font-size: 16px;
  }

  .student-learning-page .award-card p,
  .student-learning-page .panel-head p,
  .student-learning-page .lesson-practice-heading p {
    margin: 2px 0;
    line-height: 1.3;
  }

  .student-learning-page .student-chapter-field {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .student-learning-page .student-chapter-field label {
    flex: 0 0 auto;
    margin: 0;
  }

  .student-learning-page .student-chapter-panel {
    padding: 12px 14px;
    border-radius: 15px;
  }

  .student-learning-page .student-chapter-panel > .panel-head {
    margin-bottom: 4px;
  }

  .student-learning-page .panel-head h2 {
    font-size: 19px;
  }

  .student-learning-page .student-subtopic-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .student-learning-page .student-topic-levels {
    margin-top: 10px;
  }

  .student-learning-page .student-topic-levels > .panel-head {
    margin-bottom: 6px;
  }

  .student-learning-page .student-topic-levels > .panel-head p,
  .student-learning-page .lesson-practice-heading p {
    display: none;
  }

  .student-learning-page .student-topic-levels .lesson-learning {
    margin-top: 6px;
  }

  .student-learning-page .student-topic-levels .lesson-practice-heading {
    margin: 4px 0;
  }

  .student-learning-page .field select {
    min-height: 40px;
    font-size: 14px;
  }

  .student-learning-page .student-subtopic-grid {
    gap: 7px;
  }

  .student-learning-page .student-subtopic-grid .btn {
    min-height: 42px;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.25;
  }

  .student-learning-page .level-tile {
    padding: 10px;
  }

  .student-learning-page .lesson-practice-heading {
    margin: 8px 0 6px;
  }

  .student-learning-page .level-tile h3 {
    margin-bottom: 4px;
  }

  .student-learning-page .level-tile .badge-preview {
    margin: 2px 0;
    padding: 2px 6px;
  }

  .student-learning-page .level-tile .badge-preview img {
    width: 24px;
    height: 24px;
  }

  .student-learning-page .level-tile p {
    margin-top: 4px;
    line-height: 1.3;
  }

  .student-learning-page .level-tile > p:nth-of-type(2):not(.practice-level-metric) {
    display: none;
  }
}

@media (max-width: 900px) {
  .portal-content {
    padding: 24px 20px 48px;
  }

  .portal-title {
    align-items: flex-start;
    gap: 14px;
  }

  .portal-title > .pill {
    max-width: 48%;
    white-space: normal;
    text-align: right;
  }

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

  .portal-head {
    min-height: 64px;
    height: auto;
    gap: 10px;
  }

  .portal-head nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 650px) {
  .landing-head {
    min-height: 68px;
    height: auto;
    gap: 10px;
    padding: 12px 16px;
  }

  .head-right {
    text-align: right;
  }

  .landing-main {
    padding: 30px 14px 22px;
  }

  .welcome {
    margin-bottom: 26px;
  }

  .welcome h1 {
    font-size: clamp(27px, 8vw, 36px);
  }

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

  .portal-card {
    min-height: 210px;
    padding: 15px;
  }

  .portal-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 10px 14px;
  }

  .portal-head nav {
    width: 100%;
    justify-content: flex-start;
    gap: 4px;
  }

  .portal-head nav a {
    padding: 8px 9px;
  }

  .portal-content {
    padding: 20px 12px 40px;
  }

  .student-learning-page .portal-title {
    gap: 10px;
  }

  .student-header-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .student-school-name {
    max-width: calc(100% - 180px);
    font-size: 17px;
  }

  .student-learning-page .student-language-toggle {
    margin-top: 0;
  }

  .student-learning-panel {
    padding: 16px;
  }

  .student-subject-heading {
    align-items: flex-start;
  }

  .student-subject-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .student-subject-link {
    min-height: 62px;
    padding: 8px;
    border-radius: 14px;
  }

  .student-subject-name {
    font-size: var(--student-subject-font-size, 14px);
  }

  .portal-title {
    flex-direction: column;
    margin-bottom: 18px;
  }

  .portal-title > .pill {
    max-width: 100%;
    text-align: left;
  }

  .panel {
    padding: 15px;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar .field,
  .toolbar input,
  .toolbar select {
    width: 100%;
    max-width: none;
  }

  .toolbar select {
    min-width: 0;
  }

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

  .stat-card {
    padding: 13px;
  }

  .stat-card em {
    display: block;
    margin: 5px 0 0;
    line-height: 1.4;
  }

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

  .social-question-type {
    padding: 13px;
    font-size: 1rem;
  }

  .social-selected-type {
    padding: 16px;
  }

  .award-card {
    padding: 16px;
  }

  .lesson-studio .lesson-form-grid,
  .lesson-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .activity-wrap,
  .practice-wrap {
    padding: 18px 12px 40px;
  }

  .activity-card,
  .practice-card {
    padding: 16px;
  }

  .activity-top,
  .question-top {
    align-items: flex-start;
  }

  .activity-meta {
    justify-content: flex-start;
  }

  .activity-timer {
    min-width: 102px;
    padding: 6px 11px;
  }

  .activity-actions,
  .action-row {
    align-items: stretch;
  }

  .activity-actions .btn,
  .action-row .btn {
    min-height: 44px;
  }

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

  .table-wrap {
    margin-right: -4px;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 390px) {
  .portal-grid,
  .stats-grid,
  .level-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .student-subject-links {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-card {
    min-height: 0;
  }

  .portal-title h1 {
    font-size: 22px;
  }

  .lesson-learning,
  .lesson-studio {
    padding: 14px;
  }

  .question-prompt,
  .prompt {
    overflow-wrap: anywhere;
  }
}
