* {
  box-sizing: border-box;
  /* margin-top: 2px; */
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  font-family: "Segoe UI", Arial, sans-serif
}

body {
  min-height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at 82% 8%, rgba(188, 224, 250, .9), transparent 44%), radial-gradient(circle at 8% 92%, rgba(255, 237, 218, .78), transparent 46%), linear-gradient(135deg, #fbfdff, #f4f8fc 48%, #fffaf4);
  color: #222
}

button {
  font: inherit
}

#app {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center
}

.grade-page {
  position: relative;
  width: 100%;
  height: min(1080px, 100vh);
  overflow: hidden
}

.brand {
  position: absolute;
  left: 2%;
  top: 3%;
  font-size: 13px;
  line-height: 1.05;
  font-weight: 700;
  color: #ba3d42;
  z-index: 3
}

.brand:before {
  content: "M";
  font-size: 20px;
  font-weight: 900;
  margin-right: 4px;
  color: #d33d43
}

.logo {
  position: absolute;
  right: 2%;
  top: 2.7%;
  font-size: clamp(22px, 2.25vw, 34px);
  font-weight: 900;
  letter-spacing: -1.5px;
  color: #d13c43;
  z-index: 3
}

.logo span {
  color: #333;
  font-size: .42em;
  vertical-align: top
}

.grade-title {
  position: absolute;
  left: 50%;
  top: 10%;
  transform: translateX(-50%);
  margin: 0;
  font-size: clamp(25px, 2.7vw, 39px);
  font-weight: 800;
  z-index: 3
}

.nav-btn {
  position: absolute;
  top: 9.2%;
  width: clamp(42px, 4vw, 56px);
  height: clamp(42px, 4vw, 56px);
  border: 0;
  border-radius: 13px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 3px 9px rgba(0, 0, 0, .12);
  cursor: pointer;
  z-index: 5;
  display: grid;
  place-items: center
}

.nav-back {
  right: 5.5%
}

.nav-home {
  right: 1.8%
}

.nav-back:before {
  content: "â€¹";
  font-size: 40px;
  color: #6b6f73
}

.nav-home:before {
  content: "âŒ‚";
  font-size: 31px;
  color: #62676b
}

.activities {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  width: min(-50vw, 443px);
  display: flex;
  justify-content: center;
  gap: clamp(18px, 2.2vw, 30px);
  z-index: 4
}

.activity {
  width: clamp(175px, 16vw, 250px);
  aspect-ratio: 1/1.02;
  object-fit: contain;
  cursor: pointer;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .12));
  transition: .16s
}

.activity:hover {
  transform: translateY(-5px) scale(1.015)
}

.boy {
  position: absolute;
  left: 88%;
  bottom: 0%;
  transform: translateX(-50%);
  width: min(48vw, 670px);
  height: auto;
  max-height: 33%;
  object-fit: contain;
  object-position: center bottom;
  z-index: 2;
  pointer-events: none
}

.paper {
  position: absolute;
  right: 28%;
  bottom: 24%;
  width: 55px;
  height: 42px;
  transform: rotate(-25deg);
  opacity: .62
}

.paper:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 49%, #c7d6e3 50%, #b9ccdc 70%, transparent 71%);
  clip-path: polygon(0 0, 100% 15%, 34% 100%)
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(25, 35, 45, .38);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 20px
}

.overlay.show {
  display: flex
}

.popup {
  width: min(420px, 92vw);
  border-radius: 22px;
  background: #fff;
  padding: 28px;
  text-align: center;
  box-shadow: 0 25px 70px rgba(0, 0, 0, .28)
}

.popup h2 {
  margin: 0 0 10px
}

.popup p {
  margin: 0 0 20px;
  color: #666;
  line-height: 1.5
}

.close {
  border: 0;
  border-radius: 10px;
  padding: 10px 25px;
  background: #d84449;
  color: #fff;
  cursor: pointer;
  font-weight: 700
}

.selector {
  width: min(1080px, 92vw);
  padding: 38px;
  border-radius: 28px;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 18px 55px rgba(40, 65, 90, .15)
}

.selector h1 {
  text-align: center;
  margin: 0 0 28px;
  font-size: clamp(28px, 4vw, 42px)
}

.grade-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px
}

.grade-btn {
  min-height: 82px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .1);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer
}

@media(max-width:900px) {
  body {
    overflow: auto
  }

  #app {
    min-height: 100vh;
    height: auto;
    align-items: flex-start
  }

  .grade-page {
    width: 100vw;
    height: 100svh;
    min-height: 600px
  }

  .brand {
    left: 3%;
    top: 3%;
    font-size: 10px
  }

  .logo {
    right: 3%;
    top: 3%;
    font-size: 22px
  }

  .grade-title {
    top: 11%;
    font-size: 28px
  }

  .nav-btn {
    top: 9%;
    width: 44px;
    height: 44px
  }

  .nav-back {
    right: 12%
  }

  .nav-home {
    right: 3%
  }

  .activities {
    top: 20%;
    width: 92vw;
    gap: 9px
  }

  .activity {
    width: 29vw;
    max-width: 225px
  }

  .boy {
    width: 82vw;
    max-width: 650px;
    max-height: 33%;
    bottom: 1%;
    left: 81%;
  }
}

@media(max-width:520px) {
  .grade-page {
    min-height: 640px
  }

  .grade-title {
    top: 12%;
    font-size: 24px
  }

  .brand {
    display: none
  }

  .logo {
    top: 3.2%;
    right: 4%;
    font-size: 20px
  }

  .nav-btn {
    top: 10%;
    width: 38px;
    height: 38px
  }

  .nav-back {
    right: 15%
  }

  .nav-home {
    right: 4%
  }

  .activities {
    top: 22%;
    width: 96vw;
    gap: 5px
  }

  .activity {
    width: 31.5vw
  }

  .boy {
    width: 105vw;
    max-width: none;
    max-height: 49%;
    bottom: 2%;
  }

  .grade-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .selector {
    margin: 15px;
    padding: 22px 15px
  }
}


.logo-container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  /* margin: 12px 12px; */
}

.logo-container img {
  width: 120px;
  height: auto;
  display: block;
}


.mac-container {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  z-index: 4;
}

.mac-container img {
  width: 220px;
  height: auto;
  margin: 0;
  display: block;
}


.back-btn {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 2px;
}


.nav-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: -3px -7px;
}

.nav-container img {
  width: 50px;
  height: auto;
  display: block;
  margin-right: 20px;
}



.list-wrap {
  width: min(800px, 62vw);
  height: min(680px, 63vh);
  margin: 0 auto;
  position: relative
}

.topic-list {
  height: 100%;
  overflow-y: auto;
  padding: 0 18px 28px 0;
  scrollbar-width: auto;
  scrollbar-color: #d6d6d6 transparent;
  overscroll-behavior: contain
}

.topic-list::-webkit-scrollbar {
  width: 17px
}

.topic-list::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 12px;
  margin: 4px 0
}

.topic-list::-webkit-scrollbar-thumb {
  background: #d8d8d8;
  border-radius: 12px;
  border: 3px solid rgba(255, 255, 255, .75)
}

.topic {
  width: calc(80% - 16px);
  min-height: 44px;
  margin: 0px 113px 22px;
  padding: 0 31px;
  border: 4px solid #dbe5f8;
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 5px 4px rgba(84, 104, 133, .22), 0 0 13px rgba(177, 195, 224, .22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font: 500 28px/1.15 Arial, Helvetica, sans-serif;
  color: #343434;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease
}

.topic:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 8px rgba(84, 104, 133, .23), 0 0 15px rgba(177, 195, 224, .26)
}

.topic.selected {
  border-color: #b9d0f5
}

.topic b {
  font-size: 37px;
  font-weight: 500;
  color: #0aa29a;
  line-height: 1;
  margin-left: 22px
}

@media(max-width:900px) {
  .page {
    padding: 20px 20px 28px
  }

  .brand-logo {
    width: 250px
  }

  .top-actions {
    right: 20px;
    top: 108px;
    gap: 10px
  }

  .icon-button,
  .icon-button img {
    width: 64px;
    height: 64px
  }

  h1 {
    font-size: 39px;
    margin: 35px 0 45px
  }

  .list-wrap {
    width: min(800px, 88vw);
    height: 64vh
  }

  .topic {
    min-height: 72px;
    font-size: 24px;
    border-width: 3px;
    padding: 0 24px
  }
}

@media(max-width:600px) {
  .topbar {
    height: 65px
  }

  .macmillan {
    font-size: 14px
  }

  .macmillan-name {
    font-size: 14px
  }

  .macmillan-name b {
    font-size: 11px
  }

  .m-mark {
    font-size: 27px
  }

  .brand-logo {
    width: 185px
  }

  .top-actions {
    top: 90px;
    right: 18px
  }

  .icon-button,
  .icon-button img {
    width: 54px;
    height: 54px
  }

  h1 {
    font-size: 30px;
    letter-spacing: -1px;
    margin: 30px 0 35px
  }

  .list-wrap {
    width: 94vw;
    height: 68vh
  }

  .topic-list {
    padding-right: 12px
  }

  .topic {
    width: 100%;
    min-height: 64px;
    margin-bottom: 14px;
    border-radius: 14px;
    padding: 0 18px;
    font-size: 18px
  }

  .topic b {
    font-size: 27px;
    margin-left: 12px
  }
}

.slides {
  color: black;
  text-decoration: none;
}



.menu-container {
  width: 100%;
  max-width: 520px;
  margin: 30px auto;

  max-height: calc(90vh - 150px);
  overflow-y: auto;

  padding: 5px 8px 15px 5px;
}




.menu-item {
  height: 46px;
  margin-bottom: 10px;
  padding: 0 16px 0 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: #ffffff;
  border: 2px solid #e6edf7;
  border-radius: 10px;

  box-shadow:
    0 2px 3px rgba(0, 0, 0, 0.12),
    0 0 6px rgba(80, 130, 190, 0.12);

  text-decoration: none;
  color: #333333;

  font-size: 16px;
  font-weight: 400;
}

.arrow {
  color: #299b91;
  font-size: 22px;
  font-weight: bold;
  line-height: 1;
}

.menu-item:hover {
  border-color: #d5e2f2;
}

@media (max-width: 600px) {
  body {
    padding: 20px;
  }

  .menu-item {
    height: 44px;
    font-size: 15px;
  }
}



.job-sets {
  margin-top: 51px;
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.set-btn {
  padding: 14px 20px;
  border: 1px solid #333;
  background: #fff;
  cursor: pointer;
  font-weight: bold;
  border-radius: 6px;
}

.set-btn.active {
  background: #3D6DD4;
  color: #fff;
}

.worksheet {
  display: none;
}

.worksheet.active {
  display: block;
}



/* ===== Bootstrap responsive enhancement ===== */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

.grade-page {
  width: 100%;
  /* max-width: 1440px; */
  margin: 0 auto;
}

.logo-container img {
  width: clamp(130px, 10vw, 155px);
}

.mac-container img {
  width: clamp(210px, 17vw, 255px);
}

.nav-container {
  gap: 10px;
  padding-right: clamp(8px, 2vw, 24px);
}

.nav-container img {
  width: clamp(48px, 4.5vw, 62px);
}

.activities {
  width: min(94%, 1343px);
  gap: clamp(18px, 3vw, 42px);
}

.activity {
  width: clamp(180px, 18vw, 260px);
}

.menu-container {
  width: min(92%, 650px);
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.menu-item {
  min-height: 58px;
  height: auto;
  padding: 10px 18px;
  font-size: clamp(16px, 1.4vw, 20px);
}

.menu-item .arrow {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex: 0 0 30px;
}

.job-sets {
  margin-top: clamp(38px, 5vh, 58px);
  flex-wrap: wrap;
}

.set-btn {
  min-width: 100px;
  padding: 12px 22px;
}

@media (max-width:767.98px) {
  .logo-container {
    margin: 10px 12px;
  }

  .logo-container img {
    width: 130px;
  }

  .mac-container img {
    width: 190px;
    margin-top: -58px;
    margin-right: 8px;
  }

  .nav-container {
    margin: 0 4px;
    padding-right: 4px;
  }

  .nav-container img {
    width: 48px;
  }

  .grade-title {
    top: 15%;
    width: 100%;
    text-align: center;
    font-size: clamp(23px, 6vw, 30px);
  }

  .activities {
    top: 25%;
    width: 96%;
    gap: 8px;
  }

  .activity {
    width: clamp(115px, 29vw, 190px);
  }

  .boy {
    width: 30vw;
    max-width: 620px;
    left: 83%;
    bottom: 7.1%;
  }

  .menu-container {
    width: 94%;
    max-height: calc(100svh - 230px);
    margin-top: 25px;
  }

  .menu-item {
    min-height: 58px;
    font-size: 16px;
    border-radius: 12px;
  }

  .job-sets {
    margin-top: 45px;
    gap: 8px;
  }

  .set-btn {
    min-width: 88px;
    padding: 10px 16px;
  }
}

@media (max-width:480px) {
  .mac-container img {
    width: 165px;
    margin-top: -50px;
  }

  .nav-container img {
    width: 42px;
  }

  .grade-title {
    top: 15.5%;
  }

  .activities {
    top: 24%;
  }

  .activity {
    width: 29vw;
    min-width: 105px;
  }

  .menu-container {
    width: 96%;
  }

  .menu-item {
    min-height: 56px;
    padding: 9px 13px;
    font-size: 15px;
  }
}

/* More Grammar logo: centered on every grade screen. */
@media (max-width: 900px) {
  .mac-container {
    top: 14px;
    left: 50%;
    margin: 0;
  }

  .mac-container img {
    width: 185px;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .mac-container {
    top: 10px;
  }

  .mac-container img {
    width: 165px;
  }

}
.grade {
    min-height: 140px;
}

.nav-container img {
  cursor: pointer;
  transition: transform 0.25s ease,
              filter 0.25s ease,
              box-shadow 0.25s ease;
}

/* Hover effect ONLY on Back + Home images */
.nav-container img:hover {
  transform: scale(1.10);
  filter: brightness(1.05);
}

/* Click effect */
.nav-container img:active {
  transform: scale(0.95);
}
/* Phone header repair: keep Macmillan, More Math and navigation in separate zones. */
@media (max-width: 600px) {
  .grade-page { height: auto; min-height: 100svh; overflow: hidden; }
  .logo-container { position: absolute; top: 10px; left: 9px; margin: 0 !important; z-index: 10; }
  .logo-container img { width: clamp(58px, 20vw, 76px) !important; height: auto; }
  .mac-container { position: absolute; top: 12px !important; left: 50%; transform: translateX(-50%); width: auto; max-width: 40vw; z-index: 9; }
  .mac-container img { display: block; width: clamp(108px, 36vw, 138px) !important; max-width: 100%; height: auto; margin: 0 !important; }
  .nav-container { position: absolute; top: 12px; right: 7px; margin: 0 !important; padding: 0 !important; gap: 3px; z-index: 11; }
  .nav-container a { display: block; flex: 0 0 auto; }
  .nav-container img { width: clamp(27px, 8.5vw, 34px) !important; height: auto; margin: 0 !important; }
  .grade-title { top: 76px !important; left: 50%; width: 100%; padding: 0 8px; font-size: clamp(21px, 6vw, 27px) !important; line-height: 1.15; text-align: center; white-space: normal; }
  .activities { top: 145px !important; width: calc(100% - 14px) !important; gap: 5px !important; }
  .activity { width: calc((100vw - 34px) / 3) !important; min-width: 0 !important; max-width: none; height: auto; object-fit: contain; }
  .boy {max-height: 34%;object-fit: contain;object-position: center bottom;}
}
@media (max-width: 360px) {
  .logo-container img { width: 55px !important; }
  .mac-container { max-width: 38vw; }
  .mac-container img { width: 104px !important; }
  .nav-container { right: 5px; gap: 2px; }
  .nav-container img { width: 25px !important; }
  .grade-title { top: 72px !important; }
  .activities { top: 138px !important; }
}

/* Final phone layout: show every Grade 1 activity without clipping or overlap. */
@media (max-width: 600px) {
  html, body { width: 100%; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
  .grade-page { width: 100%; height: auto !important; min-height: 100svh; overflow: visible !important; padding-bottom: 24px; }
  .activities {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: min(92vw, 410px) !important;
    margin: 145px auto 24px !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: start;
    justify-items: center;
    gap: 12px !important;
  }
  .activities a { display: block; width: 100%; min-width: 0; line-height: 0; }
  .activity {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: contain !important;
  }
  .boy {/* display: none !important; */}
}
@media (max-width: 360px) {
  .activities { width: 94vw !important; margin-top: 138px !important; gap: 9px !important; }
}

/* FINAL MOBILE HEADER FIX — Grade 1 and Testing Time */
@media (max-width: 600px) {
  .grade-page { position: relative !important; }
  .logo-container {
    position: absolute !important; top: 8px !important; left: 8px !important;
    right: auto !important; margin: 0 !important; padding: 0 !important;
    width: auto !important; z-index: 20 !important;
  }
  .logo-container a { display: block !important; margin: 0 !important; padding: 0 !important; }
  .logo-container img {
    display: block !important; width: clamp(52px, 17vw, 68px) !important;
    max-width: none !important; height: auto !important; margin: 0 !important;
  }
  .mac-container {
    position: absolute !important; top: 10px !important; left: 50% !important;
    right: auto !important; transform: translateX(-50%) !important;
    width: clamp(98px, 32vw, 124px) !important; max-width: none !important;
    margin: 0 !important; padding: 0 !important; z-index: 19 !important;
  }
  .mac-container img {
    display: block !important; width: 100% !important; max-width: 100% !important;
    height: auto !important; margin: 0 !important;
  }
  .nav-container {
    position: absolute !important; top: 10px !important; right: 7px !important;
    left: auto !important; display: flex !important; flex-direction: row !important;
    align-items: center !important; justify-content: flex-end !important;
    width: auto !important; gap: 4px !important; margin: 0 !important;
    padding: 0 !important; z-index: 21 !important;
  }
  .nav-container a { display: block !important; flex: 0 0 auto !important; margin: 0 !important; padding: 0 !important; line-height: 0 !important; }
  .nav-container img {
    display: block !important; width: clamp(23px, 7.5vw, 30px) !important;
    max-width: none !important; height: auto !important; margin: 0 !important;
  }
  .grade-title {
    position: absolute !important; top: 60px !important; left: 0 !important;
    right: 0 !important; transform: none !important; width: 100% !important;
    margin: 0 !important; padding: 0 8px !important;
    font-size: clamp(19px, 5.4vw, 25px) !important; line-height: 1.2 !important;
    text-align: center !important; white-space: normal !important;
    overflow-wrap: anywhere !important; z-index: 5 !important;
  }
}
@media (max-width: 360px) {
  .logo-container img { width: 50px !important; }
  .mac-container { width: 94px !important; top: 9px !important; }
  .nav-container { right: 5px !important; gap: 3px !important; }
  .nav-container img { width: 22px !important; }
  .grade-title { top: 56px !important; font-size: 18px !important; }
}

/* MOBILE HEADER LAYOUT — FINAL OVERRIDE (Grade 1 + Testing Time)
   Keep the left logo and navigation in the first row, place More Math
   on its own row, then put the page title and cards in normal flow. */
@media (max-width: 600px) {
  html, body {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  .grade-page {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100svh !important;
    overflow: visible !important;
    padding: 0 0 24px !important;
  }
  /* Row 1: Macmillan at left; Back/Home at right. */
  .logo-container {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    right: auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 30 !important;
  }
  .logo-container a { display: block !important; margin: 0 !important; padding: 0 !important; }
  .logo-container img {
    display: block !important;
    width: clamp(48px, 15vw, 62px) !important;
    max-width: 62px !important;
    height: auto !important;
    margin: 0 !important;
  }
  .nav-container {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    width: auto !important;
    gap: 5px !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 31 !important;
  }
  .nav-container a { display: block !important; flex: 0 0 auto !important; margin: 0 !important; padding: 0 !important; line-height: 0 !important; }
  .nav-container img {
    display: block !important;
    width: clamp(22px, 7vw, 29px) !important;
    max-width: 29px !important;
    height: auto !important;
    margin: 0 !important;
  }
  /* Row 2: More Math is centered and no longer competes with either side. */
  .mac-container {
    position: absolute !important;
    top: 43px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: min(42vw, 150px) !important;
    max-width: 150px !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 20 !important;
  }
  .mac-container img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
  }
  /* Titles participate in document flow so they cannot collide with logos. */
  .grade-title {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    margin: 92px 0 0 !important;
    padding: 0 12px !important;
    font-size: clamp(18px, 5.6vw, 24px) !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    z-index: 2 !important;
  }
  .activities {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: min(92vw, 410px) !important;
    margin: 16px auto 24px !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: start !important;
    justify-items: center !important;
    gap: 12px !important;
    z-index: 1 !important;
  }
  .activities a { display: block !important; width: 100% !important; min-width: 0 !important; line-height: 0 !important; }
  .activity {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
  }
  .boy {/* display: none !important; */}
}
@media (max-width: 360px) {
  .logo-container img { width: 46px !important; }
  .nav-container { right: 6px !important; gap: 4px !important; }
  .nav-container img { width: 21px !important; }
  .mac-container { top: 41px !important; width: 38vw !important; }
  .grade-title { margin-top: 87px !important; font-size: 18px !important; padding-inline: 8px !important; }
  .activities { width: 94vw !important; gap: 9px !important; margin-top: 14px !important; }
}

/* MOBILE HEADER FIX v3: separate logo row, brand row and title row */
@media (max-width:600px) {
  .grade-page { padding-top: 0 !important; }
  .mac-container {
    position: relative !important;
    top: auto !important; left: auto !important; right: auto !important;
    transform: none !important;
    display: flex !important; justify-content: center !important; align-items: center !important;
    width: min(46vw, 170px) !important; max-width: 170px !important;
    margin: 38px auto 0 !important; padding: 0 !important;
    z-index: 2 !important;
  }
  .mac-container img { width: 100% !important; max-width: 100% !important; height: auto !important; display:block !important; }
  .grade-title {
    position: relative !important; top:auto !important; left:auto !important; right:auto !important;
    transform:none !important; margin: 7px 0 0 !important; padding: 0 10px !important;
    width:100% !important; font-size:clamp(17px,5vw,22px) !important;
    line-height:1.2 !important; text-align:center !important; z-index:2 !important;
  }
  .activities { margin-top: 14px !important; }
}
@media (max-width:360px) {
  .mac-container { margin-top: 36px !important; width: 43vw !important; }
  .grade-title { margin-top: 6px !important; font-size:17px !important; }
}
