/* Requested changes to the supplied design, following the established UX layers. */
.user-v36 .site-footer__logo { display: inline-flex; align-items: center; gap: 10px; }
/* Keep four navigation labels centred without crowding the account action. */
.user-v36 .v28-header .desktop-nav { gap: 12px 20px; }
.user-v36 .courses-heading h2 { padding-bottom: 21px; }
.user-v36 .course-card > .course-card__left { grid-column: 1; grid-row: 1; }
.user-v36 .course-card > .course-card__main { grid-column: 2; grid-row: 1; }
.user-v36 .course-card > .course-card__aside { grid-column: 3; grid-row: 1; }
/* Reset older first/last-child heights; every separator spans the same row. */
.user-v36 .course-card .course-card__stats { align-items: stretch !important; }
.user-v36 .course-card .course-card__stats > div:nth-child(n) {
  height: auto !important; min-height: 0 !important; align-self: stretch !important;
  border: 0 !important;
}
.user-v36 .course-card .course-card__stats > div:not(:last-child) { border-right: 1px solid var(--line) !important; }
.user-v36 .study-columns > .study-sidebar { grid-column: 2; grid-row: 1; align-self: start; }
.user-v36 .study-columns > .study-primary { grid-column: 1; grid-row: 1; }
.user-v36 .lesson-row .lesson-number { white-space: nowrap; overflow-wrap: normal; word-break: normal; }

/* Contacts use the same colours, typography and form dialog as the public site. */
.user-v36 .contacts-main { padding: 36px 0 64px; }
.user-v36 .contacts-heading { margin-bottom: 28px; }
.user-v36 .contacts-heading h1 { margin: 0 0 12px; font: 600 clamp(32px, 4vw, 48px)/1.15 var(--display); letter-spacing: -.035em; }
.user-v36 .contacts-heading p { margin: 0; color: var(--muted); }
.user-v36 .contacts-grid, .user-v36 .contact-document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.user-v36 .contact-panel { min-width: 0; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.user-v36 :is(.contact-panel, .contact-documents) h2 { margin: 0 0 20px; font: 600 24px/1.3 var(--display); letter-spacing: -.025em; }
.user-v36 .contact-details { display: grid; gap: 18px; margin: 0 0 24px; }
.user-v36 .contact-details dt { color: var(--muted); font-size: 13px; }
.user-v36 .contact-details dd { margin: 4px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.user-v36 .contact-details dd a { display: inline-flex; align-items: center; min-height: 44px; color: var(--green-dark); text-underline-offset: 4px; }
.user-v36 .contact-note { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.user-v36 .contact-legal-name { font-weight: 650; margin: 0 0 20px; }
.user-v36 .contact-documents { margin-top: 36px; }
.user-v36 .contact-document { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); text-decoration: none; }
.user-v36 .contact-document > span:first-child { min-width: 0; }
.user-v36 .contact-document strong { display: block; font-weight: 650; line-height: 1.45; }
.user-v36 .contact-document small { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.user-v36 a.contact-document:hover { border-color: var(--green-dark); background: var(--mint-soft); }
.user-v36 .contact-document-unavailable { background: transparent; }

@media (max-width: 1100px) and (min-width: 901px) {
  .user-v36 .v28-header .header-inner { gap: 14px; }
  .user-v36 .v28-header .desktop-nav { gap: 12px; }
  .user-v36 .v28-header .desktop-nav a { font-size: 13px; }
}
@media (max-width: 900px) {
  .user-v36 .course-card > .course-card__aside { grid-column: 1 / -1; grid-row: 2; }
  .user-v36 .course-card .course-card__stats > div:not(:last-child) { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .user-v36 .study-columns > .study-sidebar { grid-column: 1; grid-row: 1; }
  .user-v36 .study-columns > .study-primary { grid-column: 1; grid-row: 2; }
}
@media (max-width: 680px) {
  .user-v36 .course-card > .course-card__left { display: contents !important; }
  .user-v36 .course-card .course-card__media {
    /* The legacy media rule sets margin: 0 !important; override it explicitly. */
    grid-column: 1; grid-row: 1; width: calc(100% - 24px) !important; margin: 12px 12px 0 !important;
  }
  .user-v36 .course-card .course-card__media img { border-radius: inherit !important; }
  .user-v36 .course-card > .course-card__main { grid-column: 1; grid-row: 2; border-top: 0 !important; padding: 18px 18px 16px !important; }
  .user-v36 .course-card .course-card__stats { grid-column: 1; grid-row: 3; margin: 0 !important; padding: 0 18px 16px !important; }
  .user-v36 .course-card > .course-card__aside { grid-column: 1; grid-row: 4; }
  .user-v36 .additional-lesson-row,
  .user-v36 .additional-lesson-row:has(.lesson-indicator-done) { grid-template-columns: 36px minmax(0, 1fr) 24px; }
  .user-v36 .contacts-main { padding: 24px 0 40px; }
  .user-v36 .contacts-grid, .user-v36 .contact-document-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .user-v36 .contact-panel { padding: 20px; }
  .user-v36 .contact-panel .button { width: 100%; }
  .user-v36 .contact-document { padding: 18px; }
  .user-v36 :is(.contact-panel, .contact-documents) h2 { font-size: 22px; }
}

/* One outlined SVG preserves the approved wordmark, subtitle and spacing. */
:is(.user-v36, .staff-portal) .school-brand-lockup {
  display: block; width: 254px; height: auto; aspect-ratio: 1060 / 250;
  max-width: 100%; min-width: 0; flex: 0 1 auto;
  margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; object-fit: contain;
}
.user-v36 .v28-header .brand { max-width: 100%; min-width: 0; align-items: center; }
.user-v36 .v28-header .school-brand-lockup { width: 200px; }
.user-v36 .site-footer__logo { max-width: 100%; }
.staff-portal .sidebar .brand { width: 100%; min-width: 0; }
.staff-portal .sidebar .school-brand-lockup { width: 190px; }
.staff-portal .sidebar .brand:has(.sidebar-close) .school-brand-lockup { max-width: calc(100% - 44px); }
@media (max-width: 1100px) and (min-width: 901px) {
  .user-v36 .v28-header .school-brand-lockup { width: 184px; }
}
@media (max-width: 900px) {
  .user-v36 .v28-header .school-brand-lockup { width: 176px; }
}
@media (max-width: 360px) {
  .user-v36 .v28-header .school-brand-lockup { width: 156px; }
}

/* Course facts: equal breathing room on both sides of every divider. */
.user-v36 .course-card .course-card__stats > div:nth-child(n) {
  display: grid !important; grid-template-columns: minmax(0, 1fr) !important;
  align-content: start; align-items: center; justify-items: center;
  gap: 4px !important; text-align: center;
  padding: 8px 16px !important;
  padding-left: 16px !important; padding-right: 16px !important;
}
.user-v36 .course-card .course-card__stats :is(dt, dd) {
  width: 100%; min-width: 0; margin: 0 !important;
  text-align: center !important; white-space: normal !important;
  overflow-wrap: break-word; line-height: 1.4 !important;
}
.user-v36 .cd-facts > div {
  min-width: 0; padding: 8px 20px; text-align: center;
}
.user-v36 .cd-facts :is(dt, dd) {
  margin-left: 0; margin-right: 0; text-align: center; overflow-wrap: break-word;
}
@media (max-width: 900px) {
  .user-v36 .course-card .course-card__stats > div:nth-child(n) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important; padding: 12px 16px !important;
  }
  .user-v36 .cd-facts > div { padding: 8px 14px; padding-inline: 14px; }
}

/* The iframe must follow the player's ratio, not the legacy viewport min-height. */
.user-v36 .lesson-page-v61 .video-shell.is-available {
  position: relative; width: 100%; min-width: 0; min-height: 0;
  height: auto; aspect-ratio: 16 / 9; padding: 0;
}
.user-v36 .lesson-page-v61 .video-shell.is-available .video-frame {
  position: absolute; inset: 0; display: block;
  width: 100%; height: 100%; min-width: 0; min-height: 0;
  max-width: 100%; border: 0;
}
@media (min-width: 901px) {
  /* 80% of the existing shared shell; other pages keep their original width. */
  .user-v36 .learning-main.lesson-page-v61 {
    width: calc(var(--shell) * 0.8); margin-inline: auto;
    padding-top: 34px; padding-bottom: 40px;
  }
  .user-v36 .lesson-page-v61 .lesson-page-head { margin-bottom: 22px; }
  .user-v36 .lesson-page-v61 .lesson-page-head h1 {
    font-size: clamp(26px, 2.6vw, 32px); line-height: 1.2;
  }
  .user-v36 .lesson-page-v61 .lesson-layout { gap: 18px; }
  .user-v36 .lesson-page-v61 .lesson-access-card { padding: 18px 20px; gap: 20px; }
  .user-v36 .lesson-page-v61 :is(.lesson-description, .homework-section) { padding: 22px; }
}

/* Native confirmation dialog: fit content instead of stretching between insets. */
.user-v36 dialog.homework-confirm-modal {
  box-sizing: border-box; position: fixed; inset: 0; margin: auto;
  width: min(480px, calc(100% - 24px)); max-width: 480px;
  height: fit-content; min-height: 0;
  max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: 20px;
  overflow-y: auto; overscroll-behavior: contain;
}
.user-v36 dialog.homework-confirm-modal:not([open]) { display: none; }
.user-v36 dialog.homework-confirm-modal[open] { display: block; }
.user-v36 .homework-confirm-modal .homework-confirm-dialog {
  box-sizing: border-box; position: relative; display: block;
  width: 100%; height: auto; min-height: 0; max-height: none;
  padding: 28px; border: 0;
}
.user-v36 .homework-confirm-modal .homework-confirm-dialog h3 {
  margin: 0 0 12px; padding-right: 40px; font-size: 22px; line-height: 1.3;
}
.user-v36 .homework-confirm-modal .homework-confirm-dialog p {
  margin: 0; font-size: 15px; line-height: 1.5;
}
.user-v36 .homework-confirm-modal .homework-confirm-close {
  top: 12px; right: 12px; width: 44px; height: 44px;
}
.user-v36 .homework-confirm-modal .homework-confirm-actions {
  display: flex; justify-content: flex-end; flex-wrap: wrap;
  gap: 12px; margin-top: 24px;
}
.user-v36 .homework-confirm-modal .homework-confirm-actions .button {
  width: auto; min-height: 48px; white-space: normal;
}
@media (max-width: 540px) {
  .user-v36 .homework-confirm-modal .homework-confirm-dialog { padding: 24px 20px; }
  .user-v36 .homework-confirm-modal .homework-confirm-dialog h3 { font-size: 20px; padding-right: 44px; }
  .user-v36 .homework-confirm-modal .homework-confirm-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .user-v36 .homework-confirm-modal .homework-confirm-actions .button { width: 100%; }
}

/* R9: live text and inline vector art; no large raster hero download. */
.user-v36 .welcome.school-hero {
  position: relative; isolation: isolate; box-sizing: border-box;
  display: grid; place-items: center;
  width: 100%; min-height: clamp(440px, 56.18vw, 880px);
  margin: 0; padding: clamp(90px, 10vw, 170px) 24px;
  overflow: hidden; border: 0; border-radius: 0;
  background-color: #145445;
  background-image: radial-gradient(ellipse at 40% 45%, #1d6250 0%, transparent 70%),
    linear-gradient(120deg, #124d40, #174f42);
}
.user-v36 .school-hero .school-hero-title {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  align-items: flex-start; gap: clamp(10px, 1.15vw, 18px);
  width: max-content; max-width: 100%; margin: 0; padding: 0;
  color: #111713; font-family: 'Onest', Arial, sans-serif;
  font-size: clamp(28px, 5.6vw, 84px); font-weight: 350;
  line-height: 1.16; letter-spacing: -.025em; text-transform: uppercase;
  text-align: left; overflow-wrap: normal;
}
.user-v36 .school-hero .school-hero-strip {
  display: block; flex: none; box-sizing: border-box;
  max-width: 100%; padding: .08em .24em .13em;
  background: #faf5ec; box-shadow: .10em .10em 0 #d68d65;
  white-space: nowrap;
}
.user-v36 .school-hero .school-hero-strip:nth-child(1) { transform: rotate(-1deg); }
.user-v36 .school-hero .school-hero-strip:nth-child(2) { margin-left: .65em; }
.user-v36 .school-hero .school-hero-strip:nth-child(3) { margin-left: .20em; transform: rotate(-.5deg); }
.user-v36 .school-hero .school-hero-strip:nth-child(4) { margin-left: .50em; }
.user-v36 .school-hero .school-hero-title strong { font-weight: 650; }
.user-v36 .school-hero-art { position: absolute; inset: 0; z-index: 0; pointer-events: none; user-select: none; }
.user-v36 .school-hero-art svg { position: absolute; display: block; height: auto; max-width: none; }
.user-v36 .school-hero-orbits { width: 29%; top: 8%; left: 2%; }
.user-v36 .school-hero-paper { width: 22%; top: -13%; right: -3%; transform: rotate(-14deg); }
.user-v36 .school-hero-book { width: 35%; bottom: -9%; left: -4%; transform: rotate(8deg); }
.user-v36 .school-hero-accents { width: 18%; bottom: 8%; right: 5%; }
.user-v36 .school-hero-dots {
  position: absolute; left: 3%; top: 49%; width: 90px; height: 90px;
  opacity: .65; background: radial-gradient(circle, #a1c1a8 2px, transparent 3px) 0 0 / 22px 22px;
}
@media (max-width: 680px) {
  .user-v36 .welcome.school-hero {
    min-height: 360px; padding: 100px 20px 120px;
  }
  .user-v36 .school-hero .school-hero-title {
    font-size: clamp(20px, 7.2vw, 38px); gap: 12px;
  }
  .user-v36 .school-hero .school-hero-strip:nth-child(2) { margin-left: .35em; }
  .user-v36 .school-hero .school-hero-strip:nth-child(4) { margin-left: .15em; }
  .user-v36 .school-hero-orbits { width: 39%; top: 0; left: -3%; }
  .user-v36 .school-hero-paper { width: 26%; top: -8%; right: -4%; }
  .user-v36 .school-hero-book { width: 48%; bottom: -4%; left: -5%; }
  .user-v36 .school-hero-accents { width: 29%; bottom: 5%; right: 4%; }
  .user-v36 .school-hero-dots { width: 45px; height: 50px; top: auto; bottom: 28%; left: 2%; background-size: 14px 14px; }
}

/* R10: the complete first screen consists of the header and the hero. */
.user-v36 .welcome.school-hero {
  --school-hero-space: max(0px, calc(100vh - var(--school-hero-header-height, var(--header-height, 66px))));
  height: var(--school-hero-space); min-height: 0;
  padding: min(48px, calc(var(--school-hero-space) * .05)) 24px;
}
@supports (height: 100svh) {
  .user-v36 .welcome.school-hero {
    --school-hero-space: max(0px, calc(100svh - var(--school-hero-header-height, var(--header-height, 66px))));
  }
}
.user-v36 .school-hero .school-hero-title {
  font-size: min(clamp(20px, 5.6vw, 84px), calc(var(--school-hero-space) * .11));
  gap: .18em;
}
.user-v36 .school-hero-orbits { width: min(29%, calc(var(--school-hero-space) * .60)); }
.user-v36 .school-hero-paper { width: min(22%, calc(var(--school-hero-space) * .47)); }
.user-v36 .school-hero-book { width: min(35%, calc(var(--school-hero-space) * .80)); }
.user-v36 .school-hero-accents { width: min(18%, calc(var(--school-hero-space) * .45)); }
@media (max-width: 680px) {
  .user-v36 .welcome.school-hero { padding-inline: 20px; }
  .user-v36 .school-hero .school-hero-title {
    font-size: min(clamp(20px, 7.2vw, 38px), calc(var(--school-hero-space) * .11));
  }
  .user-v36 .school-hero-orbits { width: min(39%, calc(var(--school-hero-space) * .60)); }
  .user-v36 .school-hero-paper { width: min(26%, calc(var(--school-hero-space) * .47)); }
  .user-v36 .school-hero-book { width: min(48%, calc(var(--school-hero-space) * .80)); }
  .user-v36 .school-hero-accents { width: min(29%, calc(var(--school-hero-space) * .45)); }
}
