/* KIWI 爱AI Study — homepage styling aligned to the approved 1536 × 1024 mockup */
*{box-sizing:border-box}
:root {
  /* Brand palette */
  --color-navy: #101747;
  --color-blue: #0756df;
  --color-body: #222222;
  --color-soft-blue: #e5f2ff;
  --color-soft-lilac: #f0efff;
  --color-white: #ffffff;
  --color-border: #e6eaf2;

  /* Typography */
  --font-site: "Segoe UI", Tahoma, sans-serif;
  --font-size-body: 15px;

  /* Layout */
  --site-content-width: 1240px;
  --site-banner-width: 1240px;
  --site-page-gutter: 24px;

  /* Shared inner-page banner geometry */
  --inner-banner-height: 150px;
  --inner-banner-height-mobile: 150px;
  --inner-banner-radius: 22px;
  --inner-banner-padding-x: 64px;
  --inner-banner-title-size: clamp(24px, 2vw, 28px);
  --body-h2-size: var(--inner-banner-title-size);
  --body-h2-color: #123b73;
  --inner-banner-subtitle-size: 13.5px;

  /* Shared spacing */
  --inner-page-back-top: 24px;
  --inner-page-back-bottom: 22px;
  --inner-banner-body-gap: 30px;

  /* Level 4 — topic/detail page banner and return-link system */
  --topic-page-width: 1240px;
  --topic-page-gutter: 26px;
  --topic-page-back-top: 18px;
  --topic-page-back-bottom: 8px;
  --topic-back-font-size: 13px;
  --topic-back-color: #1768b2;
  --topic-banner-radius: 20px;
  --topic-banner-padding-y: 34px;
  --topic-banner-padding-x: 38px;
  --topic-banner-gap-bottom: 28px;
}
html{scroll-behavior:smooth}
body{margin:0;font-family:var(--font-site);font-size:var(--font-size-body);color:var(--color-body);background:var(--color-white)}
a{color:inherit}
.site-header{min-height:73px;display:flex;align-items:center;flex-wrap:wrap;gap:clamp(14px,1.55vw,26px);row-gap:8px;padding:7px clamp(24px,4.55vw,70px);background:#fff;border-bottom:1px solid #e6eaf2;container-type:inline-size}
.brand-lockup{display:grid;grid-template-columns:215px 1px 170px;grid-template-rows:auto;column-gap:clamp(14px,1.8vw,28px);row-gap:0;align-items:center;flex:0 0 auto}
.logo-link{grid-column:1;grid-row:1;justify-self:center;align-self:center;line-height:0}
.logo{display:block;width:215px;height:38px;object-fit:contain}
.logo-tagline{display:none}
.tag-learn{color:#1260e8}.tag-create{color:#e53935}.tag-share{color:#238b43}.tag-grow{color:#6c48a8}.tag-sep{color:#252525}
.brand-lockup>.divider{grid-column:2;grid-row:1;align-self:center;height:43px;width:0;border-left:1.5px solid #2945a1}
.author-wrap{grid-column:3;grid-row:1;align-self:center;display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.author{font:700 34px/1 "Segoe UI",Tahoma,sans-serif;color:#101747;text-decoration:none;white-space:nowrap}
.author-underline{display:block;width:88%;height:10px;margin:4px 0 0 2px}
.author-underline svg{width:100%;height:100%;display:block}
.site-nav{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:clamp(7px,1.25vw,22px);row-gap:6px;margin-left:auto;min-width:0;white-space:normal}
/* Drop nav to a full-width second row before links collide with the signature */
@container (max-width: 1280px){
 .site-header{justify-content:center}
 .brand-lockup{margin-inline:auto}
 .site-nav{flex:1 1 100%;width:100%;margin-left:0;justify-content:center}
}
.site-nav a{font-size:16px;font-weight:700;text-decoration:none;color:#101747;padding:10px 2px}
.site-nav a.active{background:#0756df;color:#fff;padding:10px 20px;border-radius:13px}
.flags{display:flex;align-items:center;gap:8px;margin-left:4px;padding-left:20px;border-left:1.5px solid #2945a1}
.flag{display:inline-flex;align-items:center;justify-content:center;width:auto;height:24px;padding:0;line-height:0;flex:0 0 auto}.flag img{display:block;width:auto;height:24px;max-width:40px;object-fit:contain;border-radius:0}
.hero{position:relative;width:100%;overflow:hidden;background:#dceafa;aspect-ratio:2172/405}
.hero>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center center;display:block}
.hero-copy{position:absolute;left:6.45%;top:18%;width:min(510px,43%);transform:none}
.hero-copy h1{margin:0;font:700 clamp(34px,3.15vw,49px)/1.02 "Segoe UI",Tahoma,sans-serif;color:#101747;letter-spacing:-.025em}
.hero-swoosh{display:block;width:295px;max-width:78%;height:22px;margin-top:9px}
.features{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px;padding:19px clamp(24px,3.4vw,53px) 14px}
.feature-card{min-height:126px;display:flex;align-items:center;gap:clamp(22px,3vw,48px);padding:12px 32px 12px 47px;border-radius:20px;text-decoration:none;color:#101747;box-shadow:none;transition:transform .15s ease,filter .15s ease}
.feature-card.math{background:#e3f1ff}
.feature-card.ai{background:#f0efff}
.feature-card:hover{transform:translateY(-2px);filter:saturate(1.06)}
.feature-icon{width:88px;height:88px;flex:0 0 88px;display:grid;place-items:center;background:transparent}
.feature-icon svg{width:82px;height:82px}
.feature-body{flex:1;min-width:0}
.feature-body b{display:block;margin:0 0 3px;font:700 clamp(25px,2.35vw,36px)/1.05 "Segoe UI",Tahoma,sans-serif;color:#101747}
.feature-body p{margin:0;font-size:clamp(15px,1.45vw,22px);font-weight:500;line-height:1.22;color:#111735}
.feature-arrow{flex:0 0 auto;font-size:38px;line-height:1;color:#0756df;font-weight:500;margin-left:4px}
.books{padding:0 clamp(24px,3.4vw,53px) 30px}
.books-head{display:flex;align-items:center;gap:32px;margin:0 0 14px;padding:0}
.books-head h2{flex:0 0 auto;margin:0;font:700 clamp(29px,2.55vw,39px)/1.2 "Segoe UI",Tahoma,sans-serif;color:#101747}
.books-head:after{content:"";height:1.5px;background:#3154bd;flex:1;min-width:20px}
.view-all{order:1;flex:0 0 auto;font-size:20px;font-weight:700;color:#0756df;text-decoration:none;white-space:nowrap;margin-left:10px}
.book-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
.book-card{height:289px;min-width:0;display:flex;align-items:center;gap:22px;padding:10px 15px;border-radius:23px;background:#fff;box-shadow:0 7px 19px rgba(31,62,119,.13);text-decoration:none;color:#101747;transition:transform .15s ease,box-shadow .15s ease}
.book-card:hover{transform:translateY(-2px);box-shadow:0 11px 25px rgba(31,62,119,.18)}
.book-card>img{width:42%;height:100%;max-width:198px;flex:0 0 42%;object-fit:contain;}
.book-card>div{height:100%;min-width:0;display:flex;flex-direction:column;align-items:flex-start;padding:4px 0 5px}
.book-card h3{margin:0 0 10px;font:700 clamp(18px,1.58vw,24px)/1.15 "Segoe UI",Tahoma,sans-serif;color:#101747;letter-spacing:-.025em}
.book-card p{margin:0;font-size:clamp(14px,1.25vw,19px);font-weight:500;line-height:1.27;color:#101747}
.learn-more{display:block;margin-top:auto;padding-bottom:3px;font-size:clamp(16px,1.45vw,22px);font-weight:700;color:#0756df;white-space:nowrap}
.social{margin:2px clamp(24px,3.05vw,47px) 22px;padding:0}
.social-bar{min-height:103px;display:flex;align-items:center;justify-content:space-between;gap:26px;padding:14px 30px;background:#eaf5ff;border-radius:29px}
.social-bar h2{flex:0 0 auto;margin:0;font:700 clamp(24px,2.25vw,34px)/1.1 "Segoe UI",Tahoma,sans-serif;color:#101747;white-space:nowrap}
.social-bar .bar-divider{height:42px;border-left:1.5px solid #2945a1;flex:0 0 auto}
.social-grid{display:flex;align-items:center;justify-content:space-between;gap:clamp(8px,1.2vw,19px);flex:1;min-width:0}
.social-grid a{display:block;line-height:0;text-decoration:none;flex:0 1 auto}
.social-grid img{display:block;width:auto;height:59px;max-width:100%;object-fit:contain}
.site-footer{text-align:center;padding:22px 20px 32px;background:#fff;color:#33467a;font-size:14px;border-top:1px solid #e8edf7}
.site-footer nav{display:flex;justify-content:center;gap:20px;flex-wrap:wrap;margin-bottom:10px}
.site-footer a{color:#0756df;font-weight:700;text-decoration:none}
a:focus-visible{outline:3px solid #0756df;outline-offset:4px;border-radius:4px}
@media(max-width:1250px){
 .site-header{gap:12px;padding-left:24px;padding-right:24px}
 .brand-lockup{grid-template-columns:180px 1px 145px;column-gap:14px}
 .logo{width:180px}
 .author{font-size:29px}
 .site-nav{gap:8px}
 .site-nav a{font-size:14px}
 .site-nav a.active{padding:9px 13px}
 .flags{padding-left:12px}
 .feature-card{padding-left:25px;gap:20px}
 .book-card{gap:13px;padding:10px}
 .book-card>img{width:39%;flex-basis:39%}
 .social-bar{gap:16px;padding:14px 20px}
 .social-grid img{height:49px}
}
@media(max-width:900px){
 .site-header{flex-wrap:wrap;justify-content:center;padding:10px 20px}
 .brand-lockup{margin:0 auto}
 .site-nav{order:2;width:100%;justify-content:center;flex-wrap:wrap;white-space:normal}
 .hero{aspect-ratio:3.8/1;min-height:220px}
 .hero-copy{left:5%;top:16%;width:55%}
 .hero-copy h1{font-size:clamp(27px,4.2vw,38px)}
 .features{gap:14px;padding:16px 20px}
 .feature-card{min-height:112px;padding:12px 16px;gap:14px}
 .feature-icon{width:62px;height:62px;flex-basis:62px}
 .feature-icon svg{width:60px;height:60px}
 .feature-body b{font-size:23px}
 .feature-body p{font-size:15px}
 .feature-arrow{font-size:28px}
 .books{padding-left:20px;padding-right:20px}
 .book-grid{gap:14px}
 .book-card{height:250px;gap:10px;padding:9px}
 .book-card>img{width:38%;flex-basis:38%}
 .book-card h3{font-size:17px}
 .book-card p{font-size:13px}
 .learn-more{font-size:16px}
 .social{margin-left:20px;margin-right:20px}
 .social-bar{flex-wrap:wrap;justify-content:center}
 .social-bar h2{font-size:25px}
 .social-grid{flex-basis:100%;justify-content:center}
}
@media(max-width:620px){
 .site-header{padding:10px 12px}
 .brand-lockup{grid-template-columns:155px 1px 120px;column-gap:10px}
 .logo{width:155px;height:32px}
 .author{font-size:23px}
 .author-underline{height:7px}
 .site-nav{gap:4px}
 .site-nav a{font-size:12px;padding:7px 5px}
 .site-nav a.active{padding:7px 10px}
 .flags{padding-left:7px;gap:4px}
 .flag{height:20px}.flag img{height:20px;max-width:34px}
 .hero{aspect-ratio:2.2/1;min-height:190px}
 .hero-copy{left:5%;top:15%;width:62%}
 .hero-copy h1{font-size:clamp(22px,5.5vw,32px)}
 .hero-swoosh{margin-top:4px;width:180px;height:14px}
 .features{grid-template-columns:1fr;padding:13px 14px;gap:10px}
 .feature-card{min-height:104px;border-radius:16px}
 .feature-body b{font-size:22px}
 .feature-body p{font-size:14px}
 .books{padding:5px 14px 22px}
 .books-head{gap:10px;margin-bottom:12px;flex-wrap:wrap}
 .books-head h2{font-size:28px}
 .view-all{font-size:15px;margin-left:auto}
 .books-head:after{display:none}
 .book-grid{grid-template-columns:1fr;gap:12px}
 .book-card{height:230px;padding:9px 13px;gap:17px}
 .book-card>img{width:40%;flex-basis:40%;max-width:160px}
 .book-card h3{font-size:19px}
 .book-card p{font-size:14px}
 .learn-more{font-size:17px}
 .social{margin:0 14px 18px}
 .social-bar{padding:17px 12px;border-radius:19px;gap:12px}
 .social-bar h2{font-size:22px}
 .social-bar .bar-divider{display:none}
 .social-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;justify-items:center}
 .social-grid img{height:46px}
}
/* Enlarge the first 3D book artwork without editing the image file */
.book-card:first-child > img{transform:scale(1.4);transform-origin:center center;}

/* Language flag controls */
button.flag {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  border-radius: 2px;
}
button.flag:focus-visible {
  outline: 2px solid #0756df;
  outline-offset: 4px;
}


/* Typography refinement: calmer, lighter and more spacious */
body { font-size: 15px; }
.author { font-size: 30px; font-weight: 650; }
.site-nav a { font-size: 15px; font-weight: 600; }
.hero-copy h1 { font-size: clamp(31px, 2.85vw, 44px); font-weight: 650; }
.feature-body b { font-size: clamp(23px, 2.05vw, 31px); font-weight: 650; }
.feature-body p { font-size: clamp(14px, 1.2vw, 18px); font-weight: 400; line-height: 1.35; color: #26334f; }
.feature-arrow { font-size: 32px; font-weight: 400; }
.books-head h2 { font-size: clamp(26px, 2.25vw, 34px); font-weight: 650; }
.view-all { font-size: 17px; font-weight: 600; }
.book-card h3 { font-size: clamp(17px, 1.35vw, 21px); font-weight: 650; line-height: 1.2; }
.book-card p { font-size: clamp(13px, 1.05vw, 16px); font-weight: 400; line-height: 1.4; color: #293650; }
.learn-more { font-size: clamp(15px, 1.2vw, 18px); font-weight: 600; }
.social-bar h2 { font-size: clamp(22px, 1.95vw, 29px); font-weight: 650; }
.site-footer { font-size: 13px; }
.site-footer a { font-weight: 600; }

@media(max-width:1250px) {
  .author { font-size: 27px; }
  .site-nav a { font-size: 13px; }
  .feature-body b { font-size: 25px; }
  .feature-body p { font-size: 14px; }
  .book-card h3 { font-size: 17px; }
  .book-card p { font-size: 13px; }
}
@media(max-width:900px) {
  .hero-copy h1 { font-size: clamp(25px, 3.8vw, 34px); }
  .feature-body b { font-size: 21px; }
  .feature-body p { font-size: 14px; }
  .books-head h2 { font-size: 25px; }
  .book-card h3 { font-size: 16px; }
  .book-card p { font-size: 13px; }
  .learn-more { font-size: 15px; }
  .social-bar h2 { font-size: 23px; }
}
@media(max-width:620px) {
  .author { font-size: 22px; }
  .site-nav a { font-size: 12px; font-weight: 600; }
  .hero-copy h1 { font-size: clamp(21px, 5vw, 29px); }
  .feature-body b { font-size: 20px; }
  .feature-body p { font-size: 13px; }
  .books-head h2 { font-size: 24px; }
  .view-all { font-size: 14px; }
  .book-card h3 { font-size: 17px; }
  .book-card p { font-size: 13px; }
  .learn-more { font-size: 15px; }
  .social-bar h2 { font-size: 20px; }
}


/* Final homepage title/banner adjustment: slightly smaller and less dominant */
.hero-copy h1 { font-size: clamp(28px, 2.55vw, 39px); font-weight: 600; }
.feature-body b { font-size: clamp(21px, 1.85vw, 28px); font-weight: 600; }

@media(max-width:1250px) {
  .hero-copy h1 { font-size: clamp(26px, 2.65vw, 35px); }
  .feature-body b { font-size: 23px; }
}
@media(max-width:900px) {
  .hero-copy h1 { font-size: clamp(23px, 3.4vw, 30px); }
  .feature-body b { font-size: 20px; }
}
@media(max-width:620px) {
  .hero-copy h1 { font-size: clamp(19px, 4.5vw, 26px); }
  .feature-body b { font-size: 19px; }
}


/* Match section headings to the Math Education feature heading */
.books-head h2,
.social-bar h2 {
  font-size: clamp(21px, 1.85vw, 28px);
  font-weight: 600;
}

/* Move the smaller hero headline lower within the banner */
.hero-copy { top: 27%; }

@media(max-width:1250px) {
  .books-head h2,
  .social-bar h2 { font-size: 23px; }
}
@media(max-width:900px) {
  .hero-copy { top: 22%; }
  .books-head h2,
  .social-bar h2 { font-size: 20px; }
}
@media(max-width:620px) {
  .hero-copy { top: 20%; }
  .books-head h2,
  .social-bar h2 { font-size: 19px; }
}


/* Book titles: match the description size, with only a modest weight increase */
.book-card h3 {
  font-size: clamp(13px, 1.05vw, 16px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  margin-bottom: 7px;
}

/* A shorter, more understated hero banner */
.hero {
  aspect-ratio: 2172 / 280;
}
@media(max-width:900px) {
  .hero {
    aspect-ratio: 5.5 / 1;
    min-height: 150px;
  }
  .hero-copy { top: 23%; }
  .book-card h3 { font-size: 14px; }
}
@media(max-width:620px) {
  .hero {
    aspect-ratio: 3.2 / 1;
    min-height: 125px;
  }
  .hero-copy { top: 19%; }
  .book-card h3 { font-size: 13px; }
}


/* Banner test: keep the full image and compress its height to about 80% */
.hero {
  aspect-ratio: 2172 / 324;
  min-height: 0;
}
.hero > img {
  object-fit: fill;
}
@media(max-width:900px) {
  .hero {
    aspect-ratio: 4.75 / 1;
    min-height: 0;
  }
}
@media(max-width:620px) {
  .hero {
    aspect-ratio: 4 / 1;
    min-height: 0;
  }
}


/* Desktop homepage fit: show the full landing page in one viewport */
@media (min-width: 901px) and (min-height: 680px) {
  html, body.home-page {
    height: 100%;
    overflow: hidden;
  }
  body.home-page {
    height: 100vh;
    height: 100svh;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  body.home-page .site-header {
    flex: 0 0 auto;
    min-height: 73px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
  body.home-page .hero {
    flex: 0 0 auto;
    width: 100%;
    height: min(11.93vw, 22vh);
    min-height: 110px;
    aspect-ratio: auto;
  }
  body.home-page .hero > img {
    object-fit: fill;
  }
  body.home-page .hero-copy {
    top: 22%;
  }
  body.home-page .features {
    flex: 0 0 clamp(100px, 14vh, 130px);
    padding-top: 9px;
    padding-bottom: 9px;
    gap: 18px;
  }
  body.home-page .feature-card {
    min-height: 0;
    height: 100%;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  body.home-page .feature-icon {
    width: 70px;
    height: 70px;
    flex-basis: 70px;
  }
  body.home-page .feature-icon svg {
    width: 66px;
    height: 66px;
  }
  body.home-page .feature-body b {
    font-size: clamp(19px, 1.65vw, 25px);
  }
  body.home-page .feature-body p {
    font-size: clamp(12px, 1vw, 15px);
    line-height: 1.25;
  }
  body.home-page .feature-arrow {
    font-size: 27px;
  }
  body.home-page .books {
    flex: 1 1 auto;
    min-height: 0;
    padding-top: 0;
    padding-bottom: 8px;
  }
  body.home-page .books-head {
    margin-bottom: 8px;
  }
  body.home-page .books-head h2,
  body.home-page .social-bar h2 {
    font-size: clamp(19px, 1.65vw, 25px);
  }
  body.home-page .book-grid {
    height: min(24vh, 230px);
    gap: 16px;
  }
  body.home-page .book-card {
    height: 100%;
    min-height: 0;
    gap: 12px;
    padding: 8px 10px;
  }
  body.home-page .book-card h3 {
    font-size: clamp(12px, .95vw, 14px);
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 6px;
  }
  body.home-page .book-card p {
    font-size: clamp(11px, .9vw, 13px);
    line-height: 1.3;
  }
  body.home-page .learn-more {
    font-size: clamp(13px, 1vw, 15px);
  }
  body.home-page .social {
    flex: 0 0 clamp(62px, 8.5vh, 82px);
    margin: 0 3.05vw 8px;
  }
  body.home-page .social-bar {
    height: 100%;
    min-height: 0;
    padding: 8px 22px;
    gap: 16px;
    border-radius: 20px;
  }
  body.home-page .social-grid img {
    height: clamp(34px, 5.2vh, 48px);
  }
  body.home-page .site-footer {
    flex: 0 0 42px;
    padding: 7px 16px;
    font-size: 11px;
  }
  body.home-page .site-footer nav {
    margin-bottom: 3px;
    gap: 14px;
  }
}

/* Keep normal scrolling on smaller screens and short browser windows. */
@media (max-width: 900px), (max-height: 679px) {
  body.home-page {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    display: block;
  }
}


/* Final homepage refinement */
.hero-copy {
  width: min(650px, 55%);
  top: 23%;
}
.hero-copy h1 {
  font-size: clamp(22px, 2.0vw, 31px);
  line-height: 1.12;
  font-weight: 600;
}

/* Keep the first book cover fully inside its card */
.book-card:first-child > img {
  transform: none;
  transform-origin: center center;
  object-fit: contain;
  max-height: 100%;
}

/* Bring the social channel panel closer to Latest Books */
@media (min-width: 901px) and (min-height: 680px) {
  body.home-page .books {
    flex: 0 0 auto;
    padding-bottom: 0;
  }
  body.home-page .book-grid {
    height: min(24vh, 230px);
  }
  body.home-page .book-card h3 {
    font-size: clamp(14px, 1.08vw, 16px);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
  }
  body.home-page .social {
    margin-top: 7px;
  }
  body.home-page .hero-copy {
    top: 22%;
    width: min(650px, 55%);
  }
  body.home-page .hero-copy h1 {
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.12;
  }
}
@media (max-width: 900px) {
  .hero-copy {
    width: 66%;
    top: 20%;
  }
  .hero-copy h1 {
    font-size: clamp(19px, 3vw, 26px);
    line-height: 1.12;
  }
  .book-card:first-child > img {
    transform: none;
  }
  .book-card h3 {
    font-size: 16px;
    font-weight: 600;
  }
}
@media (max-width: 620px) {
  .hero-copy {
    width: 72%;
    top: 17%;
  }
  .hero-copy h1 {
    font-size: clamp(17px, 4vw, 22px);
  }
}


/* Hero: reduce the current banner height by another 20% */
@media (min-width: 901px) and (min-height: 680px) {
  body.home-page .hero {
    height: min(9.54vw, 17.6vh);
    min-height: 88px;
  }
  body.home-page .hero-copy {
    top: 34%;
  }
}
@media (max-width: 900px) {
  .hero {
    aspect-ratio: 5.94 / 1;
  }
  .hero-copy { top: 30%; }
}
@media (max-width: 620px) {
  .hero {
    aspect-ratio: 5 / 1;
    min-height: 105px;
  }
  .hero-copy { top: 27%; }
}

/* Slightly enlarge the first book cover while keeping equal card-edge spacing */
.book-card:first-child > img {
  width: 46%;
  max-width: 214px;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  align-self: center;
}
@media (max-width: 900px) {
  .book-card:first-child > img {
    width: 43%;
    max-width: 175px;
  }
}
@media (max-width: 620px) {
  .book-card:first-child > img {
    width: 43%;
    max-width: 160px;
  }
}


/* Latest hero adjustment: reduce headline to 80% and add more space before the yellow arc */
@media (min-width: 901px) and (min-height: 680px) {
  body.home-page .hero-copy h1 {
    font-size: clamp(18px, 1.6vw, 24px);
  }
  body.home-page .hero-swoosh {
    margin-top: 18px;
  }
}
@media (max-width: 900px) {
  .hero-copy h1 {
    font-size: clamp(15px, 2.4vw, 21px);
  }
  .hero-swoosh {
    margin-top: 13px;
  }
}
@media (max-width: 620px) {
  .hero-copy h1 {
    font-size: clamp(14px, 3.2vw, 18px);
  }
  .hero-swoosh {
    margin-top: 10px;
  }
}

/* Latest typography and spacing refinement */
@media (min-width: 901px) and (min-height: 680px) {
  body.home-page .hero-swoosh {
    margin-top: 9px; /* half of the previous 18px gap */
  }
  body.home-page .feature-body b,
  body.home-page .books-head h2,
  body.home-page .social-bar h2 {
    font-size: clamp(16.8px, 1.48vw, 22.4px);
  }
  body.home-page .social-grid img {
    height: 47.2px;
  }
}
@media (max-width: 1250px) {
  body.home-page .social-grid img {
    height: 39.2px;
  }
}
@media (max-width: 900px) {
  body.home-page .hero-swoosh {
    margin-top: 6.5px; /* half of the previous 13px gap */
  }
  body.home-page .feature-body b,
  body.home-page .books-head h2,
  body.home-page .social-bar h2 {
    font-size: 16px;
  }
  body.home-page .social-grid img {
    height: 39.2px;
  }
}
@media (max-width: 620px) {
  body.home-page .hero-swoosh {
    margin-top: 5px; /* half of the previous 10px gap */
  }
  body.home-page .feature-body b,
  body.home-page .books-head h2,
  body.home-page .social-bar h2 {
    font-size: 15.2px;
  }
  body.home-page .social-grid img {
    height: 36.8px;
  }
}


/* Match the approved hero reference: bring the yellow curve halfway closer to the headline */
@media (min-width: 901px) and (min-height: 680px) {
  body.home-page .hero-swoosh {
    margin-top: 4.5px;
  }
}
@media (max-width: 900px) {
  body.home-page .hero-swoosh {
    margin-top: 3.25px;
  }
}
@media (max-width: 620px) {
  body.home-page .hero-swoosh {
    margin-top: 2.5px;
  }
}


/* Laptop hero typography: scale both English and Chinese headlines with the smaller banner */
@media (min-width: 901px) and (max-width: 1440px) and (min-height: 680px) {
  body.home-page .hero-copy h1 {
    font-size: clamp(16px, 1.3vw, 19px);
    line-height: 1.12;
  }
}


/* Corrected laptop breakpoint: catch high-DPI/scaled laptop viewports too */
@media (min-width: 901px) and (max-width: 1800px) and (min-height: 680px) {
  body.home-page .hero-copy h1 {
    font-size: clamp(16px, 1.25vw, 19px) !important;
    line-height: 1.12;
  }
}


/* Scale the yellow hero curve together with the headline on laptop-sized viewports */
@media (min-width: 901px) and (max-width: 1800px) and (min-height: 680px) {
  body.home-page .hero-swoosh {
    width: 236px !important;
    max-width: 62.4% !important;
    height: 17.6px !important;
    margin-top: 3.6px !important;
  }
}


/* Final hero refinement:
   scale the yellow curve proportionally with the smaller laptop banner,
   including its stroke thickness, and keep the curve compact. */
@media (min-width: 901px) and (max-width: 1800px) and (min-height: 680px) {
  body.home-page .hero-swoosh {
    width: 236px !important;
    height: 15.73px !important;
    max-width: 62.4% !important;
    margin-top: 3.6px !important;
  }
}

/* Keep the Chinese headline balanced on all desktop sizes:
   move “更简单” to the beginning of the second line. */


/* The curve is sized by JavaScript to the measured headline width. */
body.home-page .hero-copy h1 {
  width: max-content;
  max-width: 100%;
}
body.home-page .hero-copy .hero-swoosh {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  aspect-ratio: 15 / 1;
}


/* Final responsive curve fix:
   let the SVG fill the measured headline width at every screen size.
   Do not retain fixed laptop pixel dimensions; SVG height and stroke
   now scale proportionally with the width. */
body.home-page .hero-copy .hero-swoosh {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: auto !important;
}


/* Let the measured width from syncHeroSwoosh control the curve.
   SVG keeps its natural 15:1 ratio so stroke thickness scales with width. */
body.home-page .hero-copy .hero-swoosh {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  aspect-ratio: auto;
}


/* Definitive hero underline sizing: width is set from the widest actual text line by JS.
   The SVG retains its 15:1 intrinsic ratio, so stroke thickness scales with its width. */
body.home-page .hero-copy .hero-swoosh {
  display: block !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  aspect-ratio: auto !important;
}


/* Restore the original stacked homepage sections and reduce channel logos by 50% */
@media (min-width: 901px) {
  body.home-page .social-grid img {
    height: 29.5px !important;
  }
}
@media (max-width: 1250px) {
  body.home-page .social-grid img {
    height: 24.5px !important;
  }
}
@media (max-width: 900px) {
  body.home-page .social-grid img {
    height: 24.5px !important;
  }
}
@media (max-width: 620px) {
  body.home-page .social-grid img {
    height: 23px !important;
  }
}


/* Compact, centered social-channel panel */
body.home-page .social {
  margin: 2px 0 18px;
  padding: 0 16px;
}
body.home-page .social-bar {
  width: max-content;
  max-width: 100%;
  min-height: 0;
  height: auto;
  margin: 0 auto;
  padding: 11px 22px;
  gap: 16px;
  justify-content: center;
  border-radius: 18px;
}
body.home-page .social-bar h2 {
  font-size: clamp(16px, 1.45vw, 21px);
}
body.home-page .social-bar .bar-divider {
  height: 28px;
}
body.home-page .social-grid {
  flex: 0 1 auto;
  justify-content: center;
  gap: 13px;
}
body.home-page .social-grid a {
  flex: 0 0 auto;
}
body.home-page .social-grid img {
  height: 29.5px !important;
}
@media (max-width: 900px) {
  body.home-page .social-bar {
    padding: 10px 17px;
    gap: 12px;
  }
  body.home-page .social-bar h2 {
    font-size: 16px;
  }
  body.home-page .social-grid {
    gap: 10px;
  }
}
@media (max-width: 620px) {
  body.home-page .social-bar {
    width: fit-content;
    max-width: 100%;
    flex-wrap: wrap;
    row-gap: 9px;
    padding: 11px 15px;
  }
  body.home-page .social-bar .bar-divider {
    display: none;
  }
  body.home-page .social-grid {
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 10px 13px;
  }
  body.home-page .social-grid img {
    height: 23px !important;
  }
}


/* Add clear breathing room below the Latest Books cards and their shadows */
@media (min-width: 901px) {
  body.home-page .social {
    margin-top: 16px !important;
  }
}
@media (max-width: 900px) {
  body.home-page .social {
    margin-top: 20px !important;
  }
}


/* Use the finished bilingual banner artwork directly; no HTML headline overlay. */
body.home-page .hero {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 1916 / 177 !important;
  flex: 0 0 auto;
}
body.home-page .hero > img {
  width: 100%;
  height: 100%;
  object-fit: fill !important;
  display: block;
}


/* Keep the navigation-to-banner boundary subtle and consistent. */
body.home-page .site-header {
  border-bottom: 1px solid #e6eaf2 !important;
}
body.home-page .hero {
  border-top: 1px solid #e6eaf2;
  box-sizing: border-box;
}


/* Draw the navigation/banner divider above the banner image itself. */
body.home-page .site-header {
  border-bottom: 1px solid #e6eaf2 !important;
}
body.home-page .hero {
  position: relative;
  border-top: 0 !important;
}
body.home-page .hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: #e6eaf2;
  z-index: 5;
  pointer-events: none;
}


/* About page */
.about-page { overflow-x:hidden; }
.about-page main { max-width:1240px; margin:0 auto; padding:0 0 44px; box-sizing:border-box; }
.about-intro { display:grid; grid-template-columns:1.05fr .95fr; align-items:center; gap:38px; padding:48px 0 38px; }
.about-intro-copy { max-width:610px; }
.about-eyebrow { margin:0 0 12px; color:#0756df; font-size:12px; font-weight:800; letter-spacing:.16em; }
.about-lead { margin:0; max-width:590px; color:#405071; font-size:19px; line-height:1.65; }
.about-mascot-wrap { display:flex; justify-content:center; align-items:center; min-width:0; }
.about-mascot-wrap img { display:block; width:100%; max-width:570px; height:auto; object-fit:contain; }
.about-section { padding:44px 0; }
.about-section-heading { max-width:760px; margin:0 auto 27px; text-align:center; }
.about-section-heading h2,.bridge-copy h2 { margin:0; color:#101747; font-size:clamp(28px,3vw,39px); line-height:1.15; letter-spacing:-.025em; }
.section-intro { margin:14px auto 0; max-width:690px; color:#53617d; font-size:16px; line-height:1.65; }
.story-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.story-card { padding:26px 25px 27px; border:1px solid #e5ebf6; border-radius:19px; background:#fff; box-shadow:0 8px 24px rgba(31,62,119,.06); }
.story-mark { width:54px; height:54px; display:grid; place-items:center; margin-bottom:18px; border-radius:16px; font-size:25px; font-weight:800; }
.bird-mark { color:#0756df; background:#e5f2ff; }
.heart-mark { color:#e53952; background:#fff0f2; }
.ai-mark { color:#6542bd; background:#f0efff; }
.story-card h3,.method-item h3 { margin:0 0 10px; color:#101747; font-size:19px; line-height:1.25; }
.story-card p,.method-item p,.bridge-copy p { margin:0; color:#4a5875; font-size:15px; line-height:1.72; }
.philosophy-section { margin-top:8px; padding:48px 34px; border-radius:26px; background:#f4f8ff; }
.philosophy-section .about-section-heading { margin-bottom:30px; }
.method-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px 32px; }
.method-item { display:flex; align-items:flex-start; gap:17px; }
.method-item>span { flex:0 0 38px; color:#0756df; font-size:16px; font-weight:800; padding-top:2px; }
.method-item h3 { font-size:18px; }
.bridge-section { display:grid; grid-template-columns:1.12fr .88fr; gap:50px; align-items:center; padding:58px 0; }
.bridge-copy h2 { margin-bottom:19px; }
.bridge-copy p { margin:0 0 14px; }
.thinking-flow { padding:27px; border:1px solid #e2e9f6; border-radius:22px; background:#fff; box-shadow:0 8px 24px rgba(31,62,119,.07); text-align:center; }
.thinking-flow .flow-title { margin:0 0 17px; color:#101747; font-size:20px; font-weight:700; line-height:1.2; text-align:center; }
.flow-step { padding:13px 12px; border-radius:12px; background:#eaf3ff; color:#123b82; }
.flow-step b,.flow-step small { display:block; }
.flow-step b { font-size:16px; }
.flow-step small { margin-top:4px; color:#4d6389; font-size:12px; }
.flow-arrow { padding:4px 0; color:#0756df; font-size:22px; font-weight:700; }
.final-flow { background:#e9f8f1; color:#126b48; }
.final-flow small { color:#38765e; }
.about-closing { margin:10px 0 0; padding:42px 28px; border-radius:24px; background:linear-gradient(115deg,#eaf4ff,#f3f0ff); text-align:center; }
.about-closing h2 { max-width:800px; margin:0 auto 12px; color:#101747; font-size:clamp(25px,3vw,36px); line-height:1.2; }
.about-closing>p:last-child { margin:0; color:#0756df; font-weight:700; letter-spacing:.04em; }
.about-page .site-footer { margin-top:0; }
@media(max-width:900px) {
 .about-page main { padding:0 0 32px; }
 .about-intro { grid-template-columns:1fr 1fr; gap:20px; padding:35px 0 25px; }
 .about-lead { font-size:16px; }
 .story-grid { gap:12px; }
 .story-card { padding:20px 17px; }
 .story-card h3 { font-size:17px; }
 .story-card p,.method-item p,.bridge-copy p { font-size:14px; }
 .philosophy-section { padding:36px 24px; }
 .bridge-section { gap:25px; }
}
@media(max-width:620px) {
 .about-page main { padding:0 0 25px; }
 .about-intro { grid-template-columns:1fr; gap:10px; padding:30px 0 18px; }
 .about-lead { font-size:16px; }
 .about-mascot-wrap img { max-width:460px; }
 .about-section { padding:32px 0; }
 .about-section-heading { margin-bottom:22px; }
 .about-section-heading h2,.bridge-copy h2 { font-size:28px; }
 .story-grid { grid-template-columns:1fr; gap:12px; }
 .story-card { padding:21px; }
 .story-mark { margin-bottom:12px; }
 .philosophy-section { padding:30px 18px; border-radius:19px; }
 .method-grid { grid-template-columns:1fr; gap:20px; }
 .bridge-section { grid-template-columns:1fr; gap:25px; padding:36px 0; }
 .thinking-flow { padding:22px 18px; }
 .about-closing { padding:32px 19px; border-radius:18px; }
}


/* About page header fix: constrain the author wordmark just like the homepage. */
body.about-page .author-image-link {
  display: block;
  width: 170px;
  height: 55px;
  line-height: 0;
  overflow: hidden;
}
body.about-page .author-signature-image {
  display: block;
  width: 170px;
  height: 55px;
  max-width: 100%;
  object-fit: contain;
}
/* Keep the mascot prominent without letting it dominate the About introduction. */
body.about-page .about-mascot-wrap img {
  width: 100%;
  max-width: 470px;
  height: auto;
  object-fit: contain;
}
/* Only the desktop homepage is a fixed, no-scroll landing screen.
   All inner pages, including About, retain normal vertical scrolling. */
html { overflow-y: auto; }
body.about-page {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}


/* Shared inner-page banner template: same full-bleed proportions as the homepage hero. */
.page-banner {
  width: 100%;
  aspect-ratio: 2172 / 405;
  min-height: 190px;
  max-height: 310px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 28px clamp(20px, 5vw, 76px);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255,255,255,.52), transparent 42%),
    radial-gradient(ellipse at 88% 100%, rgba(255,215,133,.28), transparent 40%),
    linear-gradient(112deg, #dceaff 0%, #b9d4ff 44%, #e6efff 74%, #f6e6bd 100%);
  position: relative;
}
.page-banner::before,
.page-banner::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
}
.page-banner::before {
  width: 34vw;
  height: 34vw;
  min-width: 220px;
  min-height: 220px;
  right: -8vw;
  top: -22vw;
  border: 1px solid rgba(255,255,255,.55);
}
.page-banner::after {
  width: 24vw;
  height: 24vw;
  min-width: 160px;
  min-height: 160px;
  left: -7vw;
  bottom: -17vw;
  border: 1px solid rgba(7,86,223,.12);
}
.page-banner-inner {
  position: relative;
  z-index: 1;
  width: min(100%, 1240px);
  text-align: center;
}
.page-banner-kicker {
  margin: 0 0 8px;
  color: #1c4c91;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2em;
}
.page-banner h1 {
  margin: 0;
  color: #102d63;
  font: 700 clamp(28px, 3.4vw, 42px)/1.12 "Segoe UI", Tahoma, sans-serif;
  letter-spacing: -.025em;
}
.page-banner-inner > p:not(.page-banner-kicker) {
  margin: 9px 0 0;
  color: #35527e;
  font-size: clamp(14px, 1.35vw, 18px);
  line-height: 1.4;
}
.page-banner-accent {
  display: block;
  width: 66px;
  height: 4px;
  margin: 15px auto 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #c38a22, #f2d38a);
  box-shadow: 0 1px 5px rgba(139,95,17,.18);
}
@media (max-width: 620px) {
  .page-banner {
    min-height: 155px;
    max-height: 190px;
    aspect-ratio: auto;
    padding: 22px 16px;
  }
  .page-banner h1 { font-size: 29px; }
  .page-banner-kicker { font-size: 9px; }
  .page-banner-inner > p:not(.page-banner-kicker) { font-size: 13px; }
}
/* Match the book listing intro to the shared system after moving its title into the banner. */
.buy-intro { border-color: #e1e9f7; background: #f7faff; }


/* Keep Sherry Cai's signature identical across the homepage and every inner page. */
body .author-image-link {
  display: block;
  width: 170px;
  height: 55px;
  line-height: 0;
  overflow: hidden;
}
body .author-signature-image {
  display: block;
  width: 170px;
  height: 55px;
  max-width: 100%;
  object-fit: contain;
}


/* Final banner proportion: match the homepage hero exactly (1916:177), not a tall page masthead. */
.page-banner {
  aspect-ratio: 1916 / 177 !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 12px clamp(20px, 5vw, 76px) !important;
}
@media (max-width: 620px) {
  .page-banner {
    aspect-ratio: auto !important;
    height: 112px !important;
    min-height: 112px !important;
    max-height: 112px !important;
    padding: 10px 14px !important;
  }
  .page-banner h1 { font-size: 25px !important; }
  .page-banner-kicker { margin-bottom: 3px !important; }
  .page-banner-inner > p:not(.page-banner-kicker) { margin-top: 4px !important; }
  .page-banner-accent { margin-top: 6px !important; }
}

/* The book details area is content, not a second banner: remove its oversized gradient treatment. */
.buy-intro {
  background: #f7faff !important;
  border: 1px solid #e1e9f7 !important;
  border-radius: 18px !important;
  box-shadow: 0 5px 18px rgba(31,62,119,.05) !important;
}


/* Book page: all book identity and publication details live inside the single homepage-height banner. */
.book-page-banner {
  aspect-ratio: 1916 / 177 !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 8px clamp(24px, 5vw, 76px) !important;
  justify-content: center;
}
.book-banner-inner {
  width: min(100%, 1240px);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 42px);
  position: relative;
  z-index: 1;
}
.book-banner-cover {
  display: block;
  width: auto;
  height: min(145px, 90%);
  max-width: 105px;
  object-fit: contain;
  filter: drop-shadow(0 4px 7px rgba(16,35,75,.2));
  flex: 0 0 auto;
}
.book-banner-copy {
  min-width: 0;
  text-align: left;
}
.book-banner-copy .page-banner-kicker {
  margin: 0 0 3px;
  font-size: 9px;
  letter-spacing: .16em;
}
.book-banner-copy h1 {
  margin: 0;
  color: #102d63;
  font: 700 clamp(23px, 2.35vw, 34px)/1.08 "Segoe UI", Tahoma, sans-serif;
  letter-spacing: -.025em;
}
.book-banner-subtitle {
  margin: 4px 0 6px;
  color: #35527e;
  font-size: clamp(12px, 1.05vw, 15px);
  line-height: 1.25;
}
.book-banner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 16px;
  color: #29466f;
  font-size: 11px;
  line-height: 1.25;
}
.book-banner-meta strong { color: #173766; }
@media (max-width: 620px) {
  .book-page-banner {
    height: auto !important;
    min-height: 170px !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    padding: 12px 14px !important;
  }
  .book-banner-inner { gap: 12px; justify-content: flex-start; }
  .book-banner-cover { height: 132px; max-width: 82px; }
  .book-banner-copy { text-align: left; }
  .book-banner-copy h1 { font-size: 20px; }
  .book-banner-copy .page-banner-kicker { font-size: 8px; }
  .book-banner-subtitle { font-size: 11px; }
  .book-banner-meta { gap: 3px 9px; font-size: 9px; }
}


/* Shared compact inner-page banner template, based on the original horizontal book-page panel. */
.compact-page-banner {
  width: 100%;
  max-width: 1120px;
  min-height: 190px;
  box-sizing: border-box;
  margin: 0 auto 28px;
  padding: 22px 26px;
  display: grid;
  grid-template-columns: 190px minmax(0,1fr);
  gap: 30px;
  align-items: center;
  border: 1px solid rgba(45,78,135,.12);
  border-radius: 22px;
  background: linear-gradient(112deg, #dceaff 0%, #bfd7fb 43%, #e9edfa 72%, #f3dfb5 100%);
}
.compact-page-banner .buy-cover {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(16,23,71,.15));
}
.compact-banner-copy { min-width: 0; }
.compact-banner-kicker {
  margin: 0 0 6px;
  color: #244b83;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .17em;
}
.compact-page-banner h1 {
  margin: 0 0 8px;
  color: #102d63;
  font: 700 clamp(27px, 3vw, 38px)/1.12 "Segoe UI", Tahoma, sans-serif;
  letter-spacing: -.025em;
}
.compact-page-banner .buy-subtitle,
.compact-banner-subtitle {
  margin: 0 0 10px;
  color: #35527e;
  font-size: 16px;
  line-height: 1.4;
}
.compact-page-banner .buy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  color: #29466f;
  font-size: 13px;
}
.compact-page-banner .buy-meta strong { color: #173766; }
.about-compact-banner {
  display: flex;
  min-height: 190px;
  margin-bottom: 34px;
  padding-left: clamp(26px, 5vw, 64px);
}
.about-compact-banner .compact-banner-copy { width: 100%; }
.about-compact-banner h1 { font-size: clamp(29px, 3.2vw, 40px); }
.about-compact-banner .compact-banner-subtitle {
  margin: 0;
  color: #35527e;
  font-size: 17px;
}
.buy-page { max-width: 1120px; }
@media (max-width: 620px) {
  .compact-page-banner {
    min-height: 150px;
    padding: 17px;
    grid-template-columns: 105px minmax(0,1fr);
    gap: 14px;
    border-radius: 17px;
  }
  .compact-page-banner .buy-cover { max-height: 118px; }
  .compact-page-banner h1 { font-size: 21px; }
  .compact-page-banner .buy-subtitle,
  .compact-banner-subtitle { font-size: 12px; }
  .compact-page-banner .buy-meta { font-size: 10px; gap: 4px 9px; }
  .about-compact-banner { min-height: 150px; padding: 20px; }
  .about-compact-banner h1 { font-size: 28px; }
  .about-compact-banner .compact-banner-subtitle { font-size: 13px; }
}


/* Inner-page banners follow the homepage hero spacing and desktop height.
   The compact card remains content-width, while its top edge sits directly below the nav. */
body.about-page main { padding-top: 0 !important; }
.buy-page {
  width: min(1120px, calc(100% - 68px));
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 0 40px;
}
.compact-page-banner {
  width: 100%;
  height: clamp(140px, 9.24vw, 177px);
  min-height: 0;
  margin-top: 0;
  margin-bottom: 28px;
  padding-top: 14px;
  padding-bottom: 14px;
}
body:not(.home-page) main > .about-compact-banner {
  width: 100%;
  max-width: 100%;
}
.about-compact-banner {
  height: clamp(140px, 9.24vw, 177px);
  min-height: 0;
  margin: 0 auto 34px;
}
@media (max-width: 620px) {
  .buy-page { width: calc(100% - 32px); }
  .compact-page-banner { height: 150px; min-height: 150px; }
  .about-compact-banner { height: 150px; min-height: 150px; }
}


/* Final refinement: align inner-page banners directly with the nav divider
   and keep the book cover and typography comfortably inside the card. */
body.about-page main { padding-top: 0 !important; }
body.buy-listing-page .buy-page {
  width: min(1120px, calc(100% - 68px)) !important;
  max-width: 1120px !important;
  margin: 0 auto !important;
  padding: 0 0 40px !important;
}
.compact-page-banner,
.about-compact-banner {
  height: 175px !important;
  min-height: 175px !important;
  margin-top: 0 !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
  box-sizing: border-box !important;
  overflow: hidden;
}
.compact-page-banner {
  grid-template-columns: 170px minmax(0, 1fr) !important;
  gap: 26px !important;
  align-items: center !important;
}
.compact-page-banner .buy-cover {
  display: block;
  width: 100% !important;
  height: 126px !important;
  max-height: 126px !important;
  object-fit: contain !important;
  object-position: center center;
}
.compact-page-banner h1,
.about-compact-banner h1 {
  font-size: clamp(25px, 2.25vw, 30px) !important;
  line-height: 1.12 !important;
  margin-bottom: 6px !important;
}
.compact-banner-kicker {
  font-size: 9px !important;
  margin-bottom: 5px !important;
}
.compact-page-banner .buy-subtitle,
.compact-banner-subtitle {
  font-size: 14px !important;
  line-height: 1.3 !important;
  margin-bottom: 7px !important;
}
.compact-page-banner .buy-meta {
  font-size: 11px !important;
  gap: 5px 14px !important;
}
.about-compact-banner {
  padding-left: clamp(26px, 5vw, 64px) !important;
}
@media (max-width: 620px) {
  body.buy-listing-page .buy-page {
    width: calc(100% - 32px) !important;
    padding-bottom: 32px !important;
  }
  .compact-page-banner,
  .about-compact-banner {
    height: 150px !important;
    min-height: 150px !important;
    padding: 12px !important;
  }
  .compact-page-banner {
    grid-template-columns: 88px minmax(0, 1fr) !important;
    gap: 12px !important;
  }
  .compact-page-banner .buy-cover {
    height: 112px !important;
    max-height: 112px !important;
  }
  .compact-page-banner h1,
  .about-compact-banner h1 {
    font-size: 20px !important;
  }
  .compact-page-banner .buy-subtitle,
  .compact-banner-subtitle { font-size: 11px !important; }
  .compact-page-banner .buy-meta { font-size: 9px !important; gap: 3px 7px !important; }
}

/* Consistent previous-page navigation for inner pages */
.page-back-wrap {
  max-width: 1120px;
  margin: 24px auto 22px;
  padding: 0 2px;
}
.page-back-link {
  display: inline-flex;
  align-items: center;
  color: #0756d8;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}
.page-back-link:hover { text-decoration: underline; }
@media (max-width: 700px) {
  .page-back-wrap { margin: 18px 18px 18px; padding: 0; }
  .page-back-link { font-size: 14px; }
}


/* About page refinement: use the section-label typography in the banner,
   reduce oversized headings, and align the content column with the banner. */
.about-compact-banner .compact-banner-subtitle {
  margin: 0;
  color: #0756df;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1.3;
  text-transform: uppercase;
}
.about-compact-banner h1 {
  font-size: clamp(24px, 2vw, 28px) !important;
  line-height: 1.15 !important;
}
body.about-page .about-intro,
body.about-page .about-section,
body.about-page .about-closing {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.bird-mark { font-size: 16px; letter-spacing: -.04em; }
@media (max-width: 620px) {
  .about-compact-banner .compact-banner-subtitle { font-size: 9px; }
  .about-compact-banner h1 { font-size: 23px !important; }
}


/* About page visual refinement: lighter subtitle, smaller lead headline and mascot. */
body.about-page .about-compact-banner .compact-banner-subtitle {
  font-size: 9px !important;
  font-weight: 800;
  letter-spacing: .16em;
}
body.about-page .about-mascot-wrap img {
  max-width: 329px !important;
}
body.about-page .story-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 700px) {
  body.about-page .story-grid { grid-template-columns: 1fr; }
  body.about-page .about-mascot-wrap img { max-width: 70%; }
}


/* Keep the three About story cards side by side on desktop. */
body.about-page .story-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
@media (max-width: 700px) {
  body.about-page .story-grid {
    grid-template-columns: 1fr !important;
  }
}


/* Inner-page banner background: based on the user's approved abstract reference.
   The homepage hero is intentionally excluded and remains unchanged. */
.compact-page-banner,
.page-banner {
  background-image: url("../hero/inner-banner-blue-gold.webp") !important;
  background-size: 100% 100% !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

/* Approved abstract blue-gold banner background for inner pages only.
   Homepage hero remains completely unchanged. */
body:not(.home-page) .compact-page-banner,
body:not(.home-page) .page-banner {
  background-image: url("../hero/inner-banner-blue-gold.webp") !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}


/* Final inner-banner rendering: clean rectangular artwork, rounded by CSS only. */
body:not(.home-page) .compact-page-banner,
body:not(.home-page) .page-banner {
  background-image: url("../hero/inner-banner-blue-gold.webp") !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  border: 0 !important;
  border-radius: 22px !important;
  overflow: hidden !important;
  box-shadow: none !important;
}
body:not(.home-page) .compact-page-banner {
  min-height: 190px;
  box-sizing: border-box;
}


/* Book page banner: editorial copy left, upright book cover right. */
body.buy-listing-page .book-compact-banner {
  grid-template-columns: minmax(0, 1fr) 150px !important;
  min-height: 190px !important;
  gap: 28px !important;
  padding: 22px 30px !important;
}
body.buy-listing-page .book-compact-banner .buy-cover {
  grid-column: 2;
  grid-row: 1;
  width: 112px !important;
  height: 150px !important;
  max-height: 150px !important;
  justify-self: center;
  object-fit: contain;
}
body.buy-listing-page .book-compact-banner .compact-banner-copy {
  grid-column: 1;
  grid-row: 1;
  text-align: left;
}
body.buy-listing-page .book-compact-banner h1 {
  font-size: clamp(24px, 2.2vw, 31px) !important;
  line-height: 1.15 !important;
}
body.buy-listing-page .book-compact-banner .buy-subtitle {
  font-size: 14px !important;
  margin: 5px 0 9px !important;
}
body.buy-listing-page .book-compact-banner .buy-meta {
  font-size: 12px !important;
  gap: 5px 13px !important;
}
@media (max-width: 650px) {
  body.buy-listing-page .book-compact-banner {
    grid-template-columns: minmax(0, 1fr) 82px !important;
    gap: 10px !important;
    padding: 16px !important;
    min-height: 145px !important;
  }
  body.buy-listing-page .book-compact-banner .buy-cover {
    width: 76px !important;
    height: 112px !important;
    max-height: 112px !important;
  }
  body.buy-listing-page .book-compact-banner h1 { font-size: 19px !important; }
  body.buy-listing-page .book-compact-banner .buy-subtitle { font-size: 12px !important; }
  body.buy-listing-page .book-compact-banner .buy-meta { font-size: 10px !important; }
}


/* Banner crop correction: keep the complete artwork visible.
   The source artwork is 2172 × 328; do not use cover, which crops its top and bottom. */
body:not(.home-page) .compact-page-banner,
body:not(.home-page) .page-banner {
  background-size: 100% 100% !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  border: 0 !important;
  border-radius: 22px !important;
  overflow: visible !important;
  clip-path: inset(0 round 22px);
}
body:not(.home-page) .compact-page-banner {
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 2172 / 328;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
  box-sizing: border-box !important;
}
body.about-page .about-compact-banner {
  display: flex;
  align-items: center;
}
@media (max-width: 700px) {
  body:not(.home-page) .compact-page-banner {
    aspect-ratio: auto;
    height: 150px !important;
    min-height: 150px !important;
  }
}


/* Book page: align the cover on the left with the text block, as requested. */
body.buy-listing-page .book-compact-banner {
  grid-template-columns: 150px minmax(0, 1fr) !important;
  min-height: 0 !important;
  aspect-ratio: 2172 / 328;
  gap: 28px !important;
  padding: 14px 30px !important;
}
body.buy-listing-page .book-compact-banner .buy-cover {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 112px !important;
  height: 145px !important;
  max-height: 145px !important;
  justify-self: center;
  object-fit: contain !important;
}
body.buy-listing-page .book-compact-banner .compact-banner-copy {
  grid-column: 2 !important;
  grid-row: 1 !important;
  text-align: left;
}
@media (max-width: 650px) {
  body.buy-listing-page .book-compact-banner {
    grid-template-columns: 82px minmax(0, 1fr) !important;
    aspect-ratio: auto;
    height: 150px !important;
    padding: 12px !important;
    gap: 10px !important;
  }
  body.buy-listing-page .book-compact-banner .buy-cover {
    width: 76px !important;
    height: 112px !important;
    max-height: 112px !important;
  }
}


/* White typography on the approved blue-gold inner-page banner. */
body:not(.home-page) .compact-page-banner h1,
body:not(.home-page) .page-banner h1 {
  color: #ffffff !important;
  text-shadow: 0 2px 5px rgba(5, 35, 105, .42);
}
body:not(.home-page) .compact-page-banner .compact-banner-subtitle,
body:not(.home-page) .compact-page-banner .buy-subtitle,
body:not(.home-page) .page-banner-inner > p:not(.page-banner-kicker) {
  color: #ffffff !important;
  text-shadow: 0 1px 4px rgba(5, 35, 105, .48);
}
body:not(.home-page) .compact-page-banner .page-banner-kicker,
body:not(.home-page) .page-banner-kicker {
  color: #ffffff !important;
  text-shadow: 0 1px 4px rgba(5, 35, 105, .48);
}


/* Refined inner-banner typography: navy title, subtle white edge, gold underline. */
body:not(.home-page) .compact-page-banner .compact-banner-copy h1,
body:not(.home-page) .page-banner h1 {
  display: inline-block;
  position: relative;
  color: #082b78 !important;
  -webkit-text-stroke: .45px rgba(255,255,255,.9);
  text-shadow:
    0 2px 0 rgba(255,255,255,.48),
    0 3px 7px rgba(4,28,92,.22);
  padding-bottom: 9px;
  margin-bottom: 5px;
}
body:not(.home-page) .compact-page-banner .compact-banner-copy h1::after,
body:not(.home-page) .page-banner h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(100%, 230px);
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #ffd34d 0%, #ffe58a 72%, rgba(255,229,138,0) 100%);
  box-shadow: 0 1px 2px rgba(5,35,105,.12);
}
body:not(.home-page) .compact-page-banner .compact-banner-subtitle,
body:not(.home-page) .compact-page-banner .buy-subtitle,
body:not(.home-page) .page-banner .page-banner-inner > p:not(.page-banner-kicker) {
  color: #082b78 !important;
  font-weight: 800 !important;
  letter-spacing: .12em;
  text-shadow: 0 1px 0 rgba(255,255,255,.58);
}
body:not(.home-page) .compact-page-banner .buy-meta {
  color: #082b78 !important;
}
body:not(.home-page) .compact-page-banner .buy-meta strong {
  color: #06266d !important;
}


/* Chinese typography correction: avoid heavy outlined CJK glyphs. */
html[lang="zh-CN"] body:not(.home-page) .compact-page-banner .compact-banner-copy h1,
html[lang="zh-CN"] body:not(.home-page) .page-banner h1 {
  -webkit-text-stroke: 0 !important;
  text-shadow: 0 2px 4px rgba(4, 28, 92, .16) !important;
  color: #082b78 !important;
}
html[lang="zh-CN"] body:not(.home-page) .compact-page-banner .compact-banner-subtitle,
html[lang="zh-CN"] body:not(.home-page) .compact-page-banner .buy-subtitle,
html[lang="zh-CN"] body:not(.home-page) .page-banner .page-banner-inner > p:not(.page-banner-kicker) {
  letter-spacing: .04em !important;
  text-shadow: none !important;
  font-weight: 700 !important;
  color: #082b78 !important;
}


/* Refined Chinese title outline: crisp four-direction edge, no blurred halo. */
html[lang="zh-CN"] body:not(.home-page) .compact-page-banner .compact-banner-copy h1,
html[lang="zh-CN"] body:not(.home-page) .page-banner h1 {
  -webkit-text-stroke: 0 !important;
  color: #082b78 !important;
  text-shadow:
    -0.65px 0 0 #ffffff,
     0.65px 0 0 #ffffff,
     0 -0.65px 0 #ffffff,
     0 0.65px 0 #ffffff,
    -0.45px -0.45px 0 #ffffff,
     0.45px -0.45px 0 #ffffff,
    -0.45px 0.45px 0 #ffffff,
     0.45px 0.45px 0 #ffffff,
     0 2px 4px rgba(4, 28, 92, .16) !important;
}
html[lang="zh-CN"] body:not(.home-page) .compact-page-banner .compact-banner-subtitle,
html[lang="zh-CN"] body:not(.home-page) .compact-page-banner .buy-subtitle,
html[lang="zh-CN"] body:not(.home-page) .page-banner .page-banner-inner > p:not(.page-banner-kicker) {
  -webkit-text-stroke: 0 !important;
  text-shadow: none !important;
}


/* Header signature: match homepage placement (slightly lower in the header row). */
body .author-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transform: translateY(5px);
}
body .author-image-link {
  width: 136px !important;
  height: 44px !important;
  margin-inline: auto;
  overflow: visible;
}
body .author-signature-image {
  width: 136px !important;
  height: 44px !important;
  max-width: 100%;
  object-fit: contain !important;
}
@media (max-width: 1250px) {
  body .author-image-link,
  body .author-signature-image {
    width: 116px !important;
    height: 38px !important;
  }
}
@media (max-width: 620px) {
  body .author-image-link,
  body .author-signature-image {
    width: 104px !important;
    height: 34px !important;
  }
}


/* Further reduce the header signature to 80% of the previous displayed size. */
body .author-image-link,
body .author-signature-image {
  width: 109px !important;
  height: 35px !important;
}
@media (max-width: 1250px) {
  body .author-image-link,
  body .author-signature-image {
    width: 93px !important;
    height: 30px !important;
  }
}
@media (max-width: 620px) {
  body .author-image-link,
  body .author-signature-image {
    width: 83px !important;
    height: 27px !important;
  }
}


/* Definitive signature sizing override.
   The earlier homepage selector body.home-page .author-signature-image
   had higher specificity than the previous generic body selector.
   Match that specificity so this size actually applies on every page. */
body.home-page .author-image-link,
body.home-page .author-signature-image,
body.about-page .author-image-link,
body.about-page .author-signature-image,
body .author-image-link,
body .author-signature-image {
  width: 136px !important;
  height: 44px !important;
  max-width: 100%;
  object-fit: contain !important;
}
@media (max-width: 1250px) {
  body.home-page .author-image-link,
  body.home-page .author-signature-image,
  body.about-page .author-image-link,
  body.about-page .author-signature-image,
  body .author-image-link,
  body .author-signature-image {
    width: 116px !important;
    height: 38px !important;
  }
}
@media (max-width: 620px) {
  body.home-page .author-image-link,
  body.home-page .author-signature-image,
  body.about-page .author-image-link,
  body.about-page .author-signature-image,
  body .author-image-link,
  body .author-signature-image {
    width: 104px !important;
    height: 34px !important;
  }
}


/* Final header signature scale: 80% of the currently approved size.
   Keep the existing header column, divider, and alignment unchanged. */
body.home-page .author-image-link,
body.home-page .author-signature-image,
body.about-page .author-image-link,
body.about-page .author-signature-image,
body .author-image-link,
body .author-signature-image {
  width: 109px !important;
  height: 35px !important;
  max-width: 100%;
  object-fit: contain !important;
}
@media (max-width: 1250px) {
  body.home-page .author-image-link,
  body.home-page .author-signature-image,
  body.about-page .author-image-link,
  body.about-page .author-signature-image,
  body .author-image-link,
  body .author-signature-image {
    width: 93px !important;
    height: 30px !important;
  }
}
@media (max-width: 620px) {
  body.home-page .author-image-link,
  body.home-page .author-signature-image,
  body.about-page .author-image-link,
  body.about-page .author-signature-image,
  body .author-image-link,
  body .author-signature-image {
    width: 83px !important;
    height: 27px !important;
  }
}


/* Mobile homepage hero: restore the taller scenic composition from the earlier
   mobile layout. Desktop continues to use the existing wide banner unchanged. */
body.home-page .hero-picture {
  display: block;
  width: 100%;
  height: 100%;
}
body.home-page .hero-picture img {
  display: block;
  width: 100%;
  height: 100%;
}
body.home-page .hero-mobile-copy {
  display: none;
}

@media (max-width: 620px) {
  body.home-page .hero {
    position: relative;
    width: 100%;
    height: clamp(290px, 49.5vw, 360px) !important;
    min-height: 290px !important;
    aspect-ratio: auto !important;
    overflow: hidden;
    flex: 0 0 auto;
  }
  body.home-page .hero-picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
  body.home-page .hero-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center 54%;
  }
  body.home-page .hero-mobile-copy {
    display: block;
    position: absolute;
    z-index: 2;
    left: 5.2%;
    top: 14%;
    width: 55%;
    color: #071d58;
    pointer-events: none;
  }
  body.home-page .hero-mobile-copy h1 {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-size: clamp(25px, 5.1vw, 34px);
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: -.025em;
    color: #071d58;
    text-shadow: 0 1px 1px rgba(255,255,255,.24);
  }
  body.home-page .hero-mobile-swoosh {
    display: block;
    width: 74%;
    height: 5px;
    margin-top: 14px;
    border-radius: 100%;
    background: linear-gradient(90deg, #ffd23f 0%, #f5bd25 72%, rgba(245,189,37,0) 100%);
    transform: rotate(-5deg);
    transform-origin: left center;
  }
  html[lang^="zh"] body.home-page .hero-mobile-copy-en { display: none; }
  html[lang^="zh"] body.home-page .hero-mobile-copy-zh { display: block; }
  html:not([lang^="zh"]) body.home-page .hero-mobile-copy-en { display: block; }
  html:not([lang^="zh"]) body.home-page .hero-mobile-copy-zh { display: none; }
}


/* Mobile: use the exact same homepage hero artwork as desktop.
   Keep the banner compact and crop the panoramic image with CSS only. */
@media (max-width: 620px) {
  body.home-page .hero {
    position: relative;
    width: 100%;
    height: clamp(170px, 27vw, 205px) !important;
    min-height: 170px !important;
    max-height: 205px !important;
    aspect-ratio: auto !important;
    overflow: hidden;
    flex: 0 0 auto;
  }
  body.home-page .hero > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    /* Keep the sun in view while trimming the far-right side of the panorama. */
    object-position: 65% center !important;
  }
}


/* Dedicated bilingual mobile hero artwork.
   Desktop keeps the existing wide desktop banner and language switching. */
body.home-page .hero-mobile-banner {
  display: none;
}

@media (max-width: 620px) {
  body.home-page .hero {
    position: relative;
    width: 100%;
    height: 190px !important;
    min-height: 190px !important;
    max-height: 190px !important;
    aspect-ratio: auto !important;
    overflow: hidden;
    flex: 0 0 auto;
  }
  body.home-page .hero > #hero-banner-image {
    display: none !important;
  }
  body.home-page .hero-mobile-banner {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
  }
  html[lang^="zh"] body.home-page .hero-mobile-banner-zh {
    display: block;
  }
  html:not([lang^="zh"]) body.home-page .hero-mobile-banner-en {
    display: block;
  }
}


/* Final mobile hero correction:
   - Desktop continues to use the original desktop hero image unchanged.
   - Mobile artwork is shown at its natural panoramic ratio so the complete
     bilingual headline remains visible without being cropped. */
body.home-page .hero > .hero-mobile-banner {
  display: none !important;
}

@media (max-width: 620px) {
  body.home-page .hero {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    overflow: hidden;
    display: block;
  }

  body.home-page .hero > #hero-banner-image {
    display: none !important;
  }

  body.home-page .hero > .hero-mobile-banner {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center !important;
    vertical-align: top;
  }

  html[lang^="zh"] body.home-page .hero > .hero-mobile-banner-zh {
    display: block !important;
  }

  html:not([lang^="zh"]) body.home-page .hero > .hero-mobile-banner-en {
    display: block !important;
  }
}


/* Reliable mobile hero visibility fix.
   Desktop keeps the original desktop hero untouched.
   JavaScript switches the mobile artwork according to the selected language. */
body.home-page #hero-mobile-banner-image {
  display: none !important;
}

@media screen and (max-width: 620px) {
  body.home-page .hero {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    overflow: hidden !important;
    visibility: visible !important;
    flex: 0 0 auto !important;
  }

  body.home-page .hero > #hero-banner-image {
    display: none !important;
  }

  body.home-page .hero > #hero-mobile-banner-image {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    vertical-align: top !important;
  }
}

/* Mobile-only inner-page banner artwork. Desktop inner banners and the homepage hero remain unchanged.
   The background contains no text; page titles/subtitles stay as live HTML for both languages. */
@media (max-width: 700px) {
  body:not(.home-page) .compact-page-banner,
  body:not(.home-page) .page-banner,
  body:not(.home-page) .about-compact-banner {
    background-image: url("../hero/inner-banner-mobile.webp") !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    border-radius: 22px !important;
    overflow: hidden !important;
  }
}


/* LED Lab featured exploration card */
.led-lab-feature-inner { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(220px,.9fr); gap:24px; align-items:center; }
.led-lab-feature-inner img { width:100%; height:auto; border-radius:12px; border:1px solid #dce7f1; }
@media (max-width: 700px) {
  .led-lab-feature-inner { grid-template-columns:1fr; }
}


/* Unified inner banner for pages opened directly from the main navigation.
   The home page hero is intentionally excluded. */
body.about-page .compact-page-banner,
body.edu-page > main .edu-hero,
body.ai-page > main .ai-hero {
  min-height: 190px !important;
  height: auto !important;
  box-sizing: border-box !important;
  margin-top: 0 !important;
  margin-bottom: 30px !important;
  padding: 28px clamp(28px, 5vw, 64px) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: flex-start !important;
  gap: 0 !important;
  background-image: url("../hero/inner-banner-blue-gold.webp") !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  border: 0 !important;
  border-radius: 22px !important;
  box-shadow: none !important;
}
body.about-page .compact-page-banner h1,
body.edu-page > main .edu-hero h1,
body.ai-page > main .ai-hero h1 {
  margin: 0 0 9px !important;
  color: #102d63 !important;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
  font-size: clamp(29px, 3.2vw, 38px) !important;
  font-weight: 700 !important;
  line-height: 1.12 !important;
  letter-spacing: -.025em !important;
}
body.about-page .compact-banner-subtitle,
body.edu-page > main .edu-hero > p:not(.edu-kicker),
body.ai-page > main .ai-hero > div > p:not(.ai-kicker) {
  margin: 0 !important;
  color: #35527e !important;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  max-width: 900px !important;
}
body.edu-page > main .edu-hero .edu-kicker,
body.ai-page > main .ai-hero .ai-kicker {
  margin: 0 0 8px !important;
  color: #244b83 !important;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .17em !important;
}
@media (max-width: 620px) {
  body.about-page .compact-page-banner,
  body.edu-page > main .edu-hero,
  body.ai-page > main .ai-hero {
    min-height: 150px !important;
    padding: 20px !important;
    border-radius: 17px !important;
    margin-bottom: 22px !important;
  }
  body.about-page .compact-page-banner h1,
  body.edu-page > main .edu-hero h1,
  body.ai-page > main .ai-hero h1 {
    font-size: 25px !important;
  }
  body.about-page .compact-banner-subtitle,
  body.edu-page > main .edu-hero > p:not(.edu-kicker),
  body.ai-page > main .ai-hero > div > p:not(.ai-kicker) {
    font-size: 13px !important;
  }
}


/* Navigation landing pages share the About page's exact inner-banner geometry.
   About remains the source of truth; these rules only extend its styling to Math, AI and Books. */
body.edu-page .about-compact-banner,
body.ai-page .about-compact-banner {
  width: min(1120px, 100%) !important;
  max-width: 1120px !important;
  height: clamp(140px, 9.24vw, 177px) !important;
  min-height: 0 !important;
  margin: 0 auto 34px !important;
  padding: 0 clamp(26px, 5vw, 64px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  background-image: url("../hero/inner-banner-blue-gold.webp") !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  border: 0 !important;
  border-radius: 22px !important;
  box-shadow: none !important;
  overflow: hidden !important;
}
body.edu-page .about-compact-banner h1,
body.ai-page .about-compact-banner h1 {
  margin: 0 0 8px !important;
  color: #102d63 !important;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
  font-size: clamp(24px, 2vw, 28px) !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  letter-spacing: -.025em !important;
}
body.edu-page .about-compact-banner .compact-banner-subtitle,
body.ai-page .about-compact-banner .compact-banner-subtitle {
  margin: 0 !important;
  color: #0756df !important;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  letter-spacing: .16em !important;
  line-height: 1.3 !important;
  text-transform: uppercase !important;
  max-width: 760px !important;
}
body.edu-page .edu-main,
body.ai-page .ai-main {
  padding-top: 0 !important;
}
@media (max-width: 700px) {
  body.edu-page .about-compact-banner,
  body.ai-page .about-compact-banner {
    width: calc(100% - 36px) !important;
    height: 150px !important;
    min-height: 150px !important;
    padding: 0 20px !important;
    margin-bottom: 26px !important;
  }
  body.edu-page .about-compact-banner h1,
  body.ai-page .about-compact-banner h1 {
    font-size: 23px !important;
  }
  body.edu-page .about-compact-banner .compact-banner-subtitle,
  body.ai-page .about-compact-banner .compact-banner-subtitle {
    font-size: 9px !important;
  }
}


/* Final approved standard: Math Education banner dimensions.
   All four primary navigation landing pages use identical width, height, and inner spacing. */
body.about-page .about-compact-banner,
body.edu-page .about-compact-banner,
body.ai-page .about-compact-banner,
body.contact-page .about-compact-banner {
  width: min(1400px, calc(100% - 80px)) !important;
  max-width: 1400px !important;
  height: 175px !important;
  min-height: 175px !important;
  margin: 0 auto 30px !important;
  padding: 0 64px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  background-image: url("../hero/inner-banner-blue-gold.webp") !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  border: 0 !important;
  border-radius: 22px !important;
  box-shadow: none !important;
  overflow: hidden !important;
}
body.about-page .about-compact-banner h1,
body.edu-page .about-compact-banner h1,
body.ai-page .about-compact-banner h1,
body.contact-page .about-compact-banner h1 {
  margin: 0 0 8px !important;
  color: #102d63 !important;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
  font-size: clamp(24px, 2vw, 28px) !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  letter-spacing: -.025em !important;
}
body.about-page .about-compact-banner .compact-banner-subtitle,
body.edu-page .about-compact-banner .compact-banner-subtitle,
body.ai-page .about-compact-banner .compact-banner-subtitle,
body.contact-page .about-compact-banner .compact-banner-subtitle {
  margin: 0 !important;
  color: #0756df !important;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
  font-size: 13.5px !important;
  font-weight: 800 !important;
  letter-spacing: .16em !important;
  line-height: 1.3 !important;
  text-transform: uppercase !important;
  max-width: 760px !important;
}
@media (max-width: 700px) {
  body.about-page .about-compact-banner,
  body.edu-page .about-compact-banner,
  body.ai-page .about-compact-banner,
  body.contact-page .about-compact-banner {
    width: calc(100% - 36px) !important;
    height: 150px !important;
    min-height: 150px !important;
    padding: 0 20px !important;
    margin-bottom: 26px !important;
    border-radius: 17px !important;
  }
  body.about-page .about-compact-banner h1,
  body.edu-page .about-compact-banner h1,
  body.ai-page .about-compact-banner h1,
  body.contact-page .about-compact-banner h1 {
    font-size: 23px !important;
  }
  body.about-page .about-compact-banner .compact-banner-subtitle,
  body.edu-page .about-compact-banner .compact-banner-subtitle,
  body.ai-page .about-compact-banner .compact-banner-subtitle,
  body.contact-page .about-compact-banner .compact-banner-subtitle {
    font-size: 13.5px !important;
    letter-spacing: .10em !important;
  }
}


/* Final alignment correction: keep banner copy vertically centered.
   Use a one-column grid so inherited flex direction cannot push the title to the top. */
body.about-page .about-compact-banner,
body.edu-page .about-compact-banner,
body.ai-page .about-compact-banner,
body.contact-page .about-compact-banner {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 1fr !important;
  align-content: center !important;
  align-items: center !important;
  justify-items: start !important;
}
body.about-page .about-compact-banner .compact-banner-copy,
body.edu-page .about-compact-banner .compact-banner-copy,
body.ai-page .about-compact-banner .compact-banner-copy,
body.contact-page .about-compact-banner .compact-banner-copy {
  width: 100% !important;
  min-width: 0 !important;
  align-self: center !important;
  justify-self: start !important;
  margin: 0 !important;
}


/* About page: same Level 2 content frame as Math / AI / Books / Contact. */
body.about-page main {
  width: min(1240px, calc(100% - 64px)) !important;
  max-width: 1240px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 0 44px !important;
  box-sizing: border-box !important;
}
body.about-page main > .about-compact-banner,
body.about-page main > .page-back-wrap {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
body.about-page main > .about-compact-banner {
  height: 175px !important;
  min-height: 175px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
body.about-page main > .page-back-wrap {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
}
body.about-page .about-intro,
body.about-page .about-section,
body.about-page .about-closing {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}
@media (max-width: 700px) {
  body.about-page main {
    width: calc(100% - 36px) !important;
    max-width: none !important;
    padding: 0 0 32px !important;
  }
  body.about-page main > .about-compact-banner {
    height: 150px !important;
    min-height: 150px !important;
  }
  body.about-page main > .page-back-wrap {
    width: 100% !important;
    margin: 18px auto 18px !important;
  }
}


/* Math Education: match the About page's banner frame and outer container exactly.
   This overrides the narrower .edu-main content frame that was constraining the banner. */
body.edu-page .edu-main {
  width: 100% !important;
  max-width: 1240px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 34px 44px !important;
  box-sizing: border-box !important;
}
body.edu-page .edu-main > .about-compact-banner {
  width: min(1120px, 100%) !important;
  max-width: 1120px !important;
  height: 175px !important;
  min-height: 175px !important;
  margin: 0 auto 30px !important;
  box-sizing: border-box !important;
}
body.edu-page .edu-main > .page-back-wrap {
  width: min(1120px, 100%) !important;
  max-width: 1120px !important;
  margin: 24px auto 22px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
@media (max-width: 700px) {
  body.edu-page .edu-main {
    padding: 0 18px 32px !important;
  }
  body.edu-page .edu-main > .about-compact-banner {
    width: 100% !important;
    height: 150px !important;
    min-height: 150px !important;
  }
  body.edu-page .edu-main > .page-back-wrap {
    width: 100% !important;
    margin: 18px auto 18px !important;
  }
}


/* Math Education body content: match the banner's 1120px width exactly.
   Keep the main content, back link, and banner on the same left/right guides. */
body.edu-page .edu-main {
  width: min(1120px, calc(100% - 48px)) !important;
  max-width: 1120px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 0 44px !important;
  box-sizing: border-box !important;
}
body.edu-page .edu-main > .about-compact-banner,
body.edu-page .edu-main > .page-back-wrap {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
body.edu-page .edu-main > .about-compact-banner {
  height: 175px !important;
  min-height: 175px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
body.edu-page .edu-main > .page-back-wrap {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
}
@media (max-width: 700px) {
  body.edu-page .edu-main {
    width: calc(100% - 36px) !important;
    max-width: none !important;
    padding: 0 0 32px !important;
  }
  body.edu-page .edu-main > .about-compact-banner {
    height: 150px !important;
    min-height: 150px !important;
  }
}


/* AI Education: use the same 1120px content frame as the approved About/Math pages.
   Align the banner, Back to Home link, action buttons, and all body sections. */
body.ai-page .ai-main {
  width: min(1120px, calc(100% - 48px)) !important;
  max-width: 1120px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 0 44px !important;
  box-sizing: border-box !important;
}
body.ai-page .ai-main > .about-compact-banner,
body.ai-page .ai-main > .page-back-wrap,
body.ai-page .ai-main > .ai-actions-after-banner {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
body.ai-page .ai-main > .about-compact-banner {
  height: 175px !important;
  min-height: 175px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
body.ai-page .ai-main > .page-back-wrap {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
}
body.ai-page .ai-main > .ai-actions-after-banner {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
@media (max-width: 700px) {
  body.ai-page .ai-main {
    width: calc(100% - 36px) !important;
    max-width: none !important;
    padding: 0 0 32px !important;
  }
  body.ai-page .ai-main > .about-compact-banner {
    height: 150px !important;
    min-height: 150px !important;
  }
  body.ai-page .ai-main > .page-back-wrap {
    width: 100% !important;
    margin: 18px auto 18px !important;
  }
}







/* Contact Us: same content frame and mobile gutters as Math Education. */
body.contact-page .contact-main {
  width: min(1120px, calc(100% - 48px)) !important;
  max-width: 1120px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 0 44px !important;
  box-sizing: border-box !important;
}
body.contact-page .contact-main > .about-compact-banner,
body.contact-page .contact-main > .page-back-wrap,
body.contact-page .contact-main > .contact-layout {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
body.contact-page .contact-main > .about-compact-banner {
  height: 175px !important;
  min-height: 175px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
body.contact-page .contact-main > .page-back-wrap {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
}
@media (max-width: 700px) {
  body.contact-page .contact-main {
    width: calc(100% - 36px) !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 0 32px !important;
  }
  body.contact-page .contact-main > .about-compact-banner {
    width: 100% !important;
    height: 150px !important;
    min-height: 150px !important;
    padding: 0 20px !important;
  }
  body.contact-page .contact-main > .page-back-wrap {
    width: 100% !important;
    margin: 18px 0 !important;
  }
  html body.contact-page .contact-main > .about-compact-banner,
  html body.contact-page .contact-main > .page-back-wrap {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}


/* Exact vertical-spacing rule shared with Math Education:
   .edu-section uses margin-top: 42px; About intro now uses the same rule.
   Remove intro top padding so spacing is not counted twice. */
body.about-page .about-intro {
  margin-top: 42px !important;
  padding-top: 0 !important;
}
@media (max-width: 700px) {
  body.about-page .about-intro {
    margin-top: 30px !important;
    padding-top: 0 !important;
  }
}
body.about-page .about-intro .about-lead {
  margin: 0 0 22px !important;
  max-width: 900px !important;
  color: #5e6f88 !important;
  font-size: 16px !important;
  line-height: 1.75 !important;
}
@media (max-width: 700px) {
  body.about-page .about-intro .about-lead {
    font-size: 16px !important;
    line-height: 1.75 !important;
  }
}


/* Improve inner-banner subtitle contrast on the blue background.
   Darker blue lettering with a clearer white outline for readability. */
body.about-page .about-compact-banner .compact-banner-subtitle,
body.edu-page .about-compact-banner .compact-banner-subtitle,
body.ai-page .about-compact-banner .compact-banner-subtitle {
  color: #003b8f !important;
  -webkit-text-stroke: 0.8px #ffffff;
  paint-order: stroke fill;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.9);
}


/* Homepage learning pathways: three equal entry cards in one row. */
body.home-page .features {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
body.home-page .feature-card.learning {
  background: #e8f5f0;
}
body.home-page .feature-card {
  min-width: 0;
}
@media (max-width: 900px) and (min-width: 621px) {
  body.home-page .features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding-left: 16px;
    padding-right: 16px;
  }
  body.home-page .feature-card {
    min-height: 112px;
    padding: 10px 12px;
    gap: 10px;
  }
  body.home-page .feature-icon {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }
  body.home-page .feature-icon svg {
    width: 48px;
    height: 48px;
  }
  body.home-page .feature-body b {
    font-size: 18px;
  }
  body.home-page .feature-body p {
    font-size: 12px;
    line-height: 1.3;
  }
  body.home-page .feature-arrow {
    font-size: 22px;
  }
}
@media (max-width: 620px) {
  body.home-page .features {
    grid-template-columns: 1fr;
  }
}


/* Final background-crop standard: use the same full artwork framing
   across every inner-page banner, matching the Contact Us reference.
   Keep the existing mobile artwork selection and all banner dimensions intact. */
body:not(.home-page) .compact-page-banner,
body:not(.home-page) .about-compact-banner,
body:not(.home-page) .page-banner,
body:not(.home-page) .edu-hero,
body:not(.home-page) .ai-hero,
body:not(.home-page) .contact-banner {
  background-size: 100% 100% !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}


/* Unified primary inner-page banner height — Contact Us is the reference. */
.compact-page-banner,
.about-compact-banner,
.contact-banner {
  height: 150px !important;
  min-height: 150px !important;
  max-height: 150px !important;
  box-sizing: border-box !important;
}
@media (max-width: 760px) {
  .compact-page-banner,
  .about-compact-banner,
  .contact-banner {
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
  }
}


/* Corrected banner-height normalization.
   The earlier aspect-ratio rule had higher specificity than the first height rule,
   so some pages continued to render taller. Disable that ratio and force the
   Contact Us reference height on every inner-page banner. */
html body:not(.home-page) main .compact-page-banner,
html body:not(.home-page) main .about-compact-banner,
html body:not(.home-page) main .contact-banner {
  height: 150px !important;
  min-height: 150px !important;
  max-height: 150px !important;
  aspect-ratio: auto !important;
  box-sizing: border-box !important;
}

@media (max-width: 760px) {
  html body:not(.home-page) main .compact-page-banner,
  html body:not(.home-page) main .about-compact-banner,
  html body:not(.home-page) main .contact-banner {
    height: 175px !important;
    min-height: 175px !important;
    max-height: 175px !important;
    aspect-ratio: auto !important;
  }
}


/* ==========================================================================
   GLOBAL DESIGN SYSTEM — CANONICAL SHARED COMPONENTS
   Source of truth for shared page geometry and typography.
   Update :root tokens above instead of adding page-specific overrides.
   ========================================================================== */

/* Shared inner-page banner used by all primary navigation landing pages. */
html body:not(.home-page) main .compact-page-banner,
html body:not(.home-page) main .about-compact-banner,
html body:not(.home-page) main .page-banner,
html body:not(.home-page) main .edu-hero,
html body:not(.home-page) main .ai-hero,
html body:not(.home-page) main .contact-banner {
  height: var(--inner-banner-height) !important;
  min-height: var(--inner-banner-height) !important;
  max-height: var(--inner-banner-height) !important;
  aspect-ratio: auto !important;
  box-sizing: border-box !important;
  border-radius: var(--inner-banner-radius) !important;
  background-size: 100% 100% !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

/* Primary navigation banner frame. Full width inside main; main holds the 1240px gutters. */
html body.about-page main > .about-compact-banner,
html body.edu-page main > .about-compact-banner,
html body.ai-page main > .about-compact-banner,
html body.contact-page main > .about-compact-banner,
html body.books-page main > .about-compact-banner,
html body.in-class-page main > .about-compact-banner,
html body.edu-page .edu-main > .about-compact-banner,
html body.ai-page .ai-main > .about-compact-banner,
html body.contact-page .contact-main > .about-compact-banner {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: var(--inner-banner-padding-x) !important;
  padding-right: var(--inner-banner-padding-x) !important;
  box-sizing: border-box !important;
}

/* Shared title styling for primary navigation banners. */
html body:not(.home-page) main .about-compact-banner h1 {
  margin: 0 0 8px !important;
  color: #102d63 !important;
  font-family: var(--font-site) !important;
  font-size: var(--inner-banner-title-size) !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.025em !important;
}

/* Shared subtitle styling — same size, color, weight and spacing across pages. */
html body:not(.home-page) main .about-compact-banner .compact-banner-subtitle {
  margin: 0 !important;
  max-width: 760px !important;
  color: #003b8f !important;
  font-family: var(--font-site) !important;
  font-size: var(--inner-banner-subtitle-size) !important;
  font-weight: 800 !important;
  letter-spacing: 0.16em !important;
  line-height: 1.3 !important;
  text-transform: uppercase !important;
  -webkit-text-stroke: 0.8px #ffffff;
  paint-order: stroke fill;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.9);
}

/* Back link alignment and spacing. Full width inside main on Level 2 landings. */
html body:not(.home-page) main > .page-back-wrap,
html body.edu-page .edu-main > .page-back-wrap,
html body.ai-page .ai-main > .page-back-wrap,
html body.contact-page .contact-main > .page-back-wrap {
  width: 100% !important;
  max-width: 100% !important;
  margin: var(--inner-page-back-top) 0 var(--inner-page-back-bottom) !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Shared main content width for primary navigation landing pages. */
html body.about-page main,
html body.edu-page main,
html body.ai-page main,
html body.contact-page main,
html body.books-page main,
html body.in-class-page main {
  box-sizing: border-box;
}

/* Mobile geometry: min height matches peers; banner grows to fit wrapped title/subtitle. */
@media (max-width: 700px) {
  html body:not(.home-page) main .compact-page-banner,
  html body:not(.home-page) main .about-compact-banner,
  html body:not(.home-page) main .page-banner,
  html body:not(.home-page) main .edu-hero,
  html body:not(.home-page) main .ai-hero,
  html body:not(.home-page) main .contact-banner {
    height: auto !important;
    min-height: var(--inner-banner-height-mobile) !important;
    max-height: none !important;
    overflow: visible !important;
    border-radius: 17px !important;
  }

  html body.about-page main .about-compact-banner,
  html body.edu-page main .about-compact-banner,
  html body.ai-page main .about-compact-banner,
  html body.contact-page main .about-compact-banner,
  html body.books-page main .about-compact-banner,
  html body.in-class-page main .about-compact-banner {
    width: calc(100% - 36px) !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  html body:not(.home-page) main .about-compact-banner h1 {
    font-size: 23px !important;
  }

  html body:not(.home-page) main .about-compact-banner .compact-banner-subtitle {
    font-size: 13.5px !important;
    letter-spacing: 0.10em !important;
  }

  html body:not(.home-page) main .page-back-wrap {
    width: calc(100% - 36px) !important;
    margin-top: 18px !important;
    margin-bottom: 18px !important;
  }
}


/* ==========================================================================
   BODY H2 STANDARD — same size as the inner-page banner title
   Every H2 in page content uses one consistent size, deep-blue color and weight.
   H2 must never become larger than the banner title.
   ========================================================================== */
body main h2 {
  font-family: var(--font-site) !important;
  font-size: var(--body-h2-size) !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  color: var(--body-h2-color) !important;
  letter-spacing: -0.025em !important;
}

/* Keep the same hierarchy on narrow screens; the shared token scales with viewport. */
@media (max-width: 700px) {
  body main h2 {
    font-size: var(--body-h2-size) !important;
  }
}


/* About intro heading: layout only; shared body H2 rule controls typography and color. */
body.about-page .about-intro h2 {
  margin: 0 0 12px !important;
}


/* About Us: align the first intro title with the Math Education section title.
   The intro grid is vertically centered beside the mascot, which makes the
   copy start lower than the Math Education heading. Lift only the copy block;
   keep the mascot and the rest of the page layout unchanged. */
@media (min-width: 701px) {
  body.about-page .about-intro-copy {
    transform: translateY(-14px);
  }
}
@media (max-width: 700px) {
  body.about-page .about-intro-copy {
    transform: none;
  }
}


/* ==========================================================================
   LEVEL 4 — TOPIC / DETAIL PAGE COMPONENTS
   Number Families is the approved visual reference for this page level.
   Keep its topic-specific banner appearance, but use shared frame and link tokens.
   ========================================================================== */
.topic-page {
  --topic-ink: #142b50;
  --topic-muted: #5d6f86;
}

.topic-page .topic-main {
  width: min(var(--topic-page-width), 100%);
  margin: 0 auto;
  padding: 0 var(--topic-page-gutter) 64px;
  box-sizing: border-box;
}

.topic-page .topic-back-wrap {
  padding: var(--topic-page-back-top) 0 var(--topic-page-back-bottom);
  margin: 0;
}

.topic-page .topic-back-wrap a {
  color: var(--topic-back-color);
  font-family: var(--font-site);
  font-size: var(--topic-back-font-size);
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.topic-page .topic-banner {
  position: relative;
  overflow: hidden;
  margin: 0 0 var(--topic-banner-gap-bottom);
  padding: var(--topic-banner-padding-y) var(--topic-banner-padding-x);
  border: 1px solid #d8e8f8;
  border-radius: var(--topic-banner-radius);
  box-sizing: border-box;
}

@media (max-width: 760px) {
  :root {
    --topic-page-gutter: 15px;
    --topic-page-back-top: 18px;
    --topic-page-back-bottom: 8px;
    --topic-banner-padding-y: 26px;
    --topic-banner-padding-x: 22px;
  }
}




/* ==========================================================================
   GLOBAL BODY TEXT COLOR — SITE-WIDE STANDARD
   Keep all non-legal page body copy consistently near-black for readability.
   Headings, links, navigation, badges, and brand accents retain their own colors.
   Legal pages are intentionally excluded and keep their separate styling.
   ========================================================================== */
body:not(.legal-page) :is(p, li, td, dd, blockquote, figcaption, small, label) {
  color: #222222 !important;
}

/* ==========================================================================
   GLOBAL BODY TYPOGRAPHY — BILINGUAL SITE-WIDE STANDARD
   One consistent size, weight, line-height and body color for all non-legal
   page copy, in both English and Chinese. Headings and UI labels are excluded.
   ========================================================================== */
body:not(.legal-page) :is(p, li, td, th, dd, dt, blockquote, figcaption) {
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
  color: #222222 !important;
}

/* Chinese uses a suitable system font; English keeps the existing site font. */
html[lang="zh-CN"] body:not(.legal-page) {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}
html[lang="zh-CN"] body:not(.legal-page) :is(p, li, td, th, dd, dt, blockquote, figcaption) {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif !important;
}


/* ==========================================================================
   SITE-WIDE BANNER HEIGHT — SINGLE STANDARD
   Levels 2–3 inner-page banners use 150px on desktop (min height on mobile; grow with text).
   The homepage hero is intentionally excluded and retains its original
   responsive aspect ratio and artwork proportions.
   ========================================================================== */
html body :is(
  .page-banner,
  .compact-page-banner,
  .about-compact-banner,
  .book-compact-banner,
  .book-page-banner,
  .contact-banner,
  .legal-banner,
  .edu-hero,
  .ai-hero,
  .ai-detail-hero,
  .car-hero
) {
  height: 150px !important;
  min-height: 150px !important;
  max-height: 150px !important;
  aspect-ratio: auto !important;
  box-sizing: border-box !important;
}

/* Topic / leaf banners (.nf-hero.topic-banner, .topic-banner) use content height — not the 150px cap. */

/* FINAL OVERRIDE: exact 150px height for every inner-page banner.
   This intentionally comes last to defeat older page-level and mobile 175px rules.
   The homepage hero is excluded and keeps its original responsive ratio. */
html body:not(.home-page) main :is(
  .page-banner,
  .compact-page-banner,
  .about-compact-banner,
  .book-compact-banner,
  .book-page-banner,
  .contact-banner,
  .legal-banner,
  .edu-hero,
  .ai-hero,
  .ai-detail-hero,
  .car-hero
),
html body.nf-page .nf-main > .nf-hero:not(.topic-banner) {
  height: 150px !important;
  min-height: 150px !important;
  max-height: 150px !important;
  aspect-ratio: auto !important;
  box-sizing: border-box !important;
}
@media (max-width: 760px) {
  html body:not(.home-page) main :is(
    .page-banner,
    .compact-page-banner,
    .about-compact-banner,
    .book-compact-banner,
    .book-page-banner,
    .contact-banner,
    .legal-banner,
    .edu-hero,
    .ai-hero,
    .ai-detail-hero,
    .car-hero,
    .nf-hero,
    .topic-banner,
    .topic-page .topic-banner
  ),
  html body.nf-page .nf-main > .nf-hero {
    height: auto !important;
    min-height: var(--inner-banner-height-mobile, 150px) !important;
    max-height: none !important;
    overflow: visible !important;
    aspect-ratio: auto !important;
  }
}

/* Google Drive-style breadcrumb navigation */
.drive-breadcrumb {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 18px 0 8px;
  padding: 0;
  min-height: 34px;
  color: #26384d;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
}
.drive-crumb-part { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.drive-crumb-link {
  color: #26384d;
  text-decoration: none;
  white-space: nowrap;
}
.drive-crumb-link:hover { color: #1768b2; text-decoration: underline; }
.drive-crumb-current { color: #26384d; font-weight: 500; }
.drive-crumb-separator { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: #758397; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drive-crumb-menu-wrap { position: relative; display: inline-flex; align-items: center; }
.drive-crumb-menu-button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #45566c;
  cursor: pointer;
}
.drive-crumb-menu-button:hover,
.drive-crumb-menu-button[aria-expanded="true"] { background: #edf2f8; }
.drive-crumb-menu-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drive-crumb-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 36px));
  max-height: 60vh;
  overflow: auto;
  padding: 6px;
  border: 1px solid #dce3eb;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 42, 70, .16);
}
.drive-crumb-menu[hidden] { display: none; }
.drive-crumb-menu a {
  display: block;
  padding: 9px 11px;
  border-radius: 6px;
  color: #26384d;
  font-size: 14px;
  text-decoration: none;
}
.drive-crumb-menu a:hover { background: #f0f5fb; color: #1768b2; }
@media (max-width: 640px) {
  .drive-breadcrumb { width: 100%; margin: 14px 0 7px; padding: 0; gap: 3px; font-size: 14px; }
  .drive-crumb-part { gap: 2px; }
  .drive-crumb-separator { width: 14px; height: 14px; flex-basis: 14px; }
  .drive-crumb-menu { right: auto; left: 0; }
}


/* In-Class Learning CTA: protect readable contrast from global typography rules */
html body .edu-cta,
html body .edu-cta * {
  color: #ffffff !important;
}
html body .edu-cta p {
  color: #e3edf9 !important;
}
html body .edu-cta .edu-button {
  background: #ffffff !important;
  color: #173e70 !important;
}

/* Instructor profile: text-led layout without the former Sherry Cai signature image */
.edu-instructor-no-photo { display: block; }
.edu-instructor-no-photo .instructor-name {
  margin: 0 0 12px;
  color: #173e70;
  font-size: 23px;
  line-height: 1.25;
}
.edu-instructor-no-photo .edu-lead { max-width: none; }


/* Consistent footer hierarchy across the homepage and inner pages */
.site-footer { font-size: 13px; }
.site-footer nav { margin-bottom: 7px; }
.site-footer p { margin: 0; font-size: inherit; line-height: 1.35; font-weight: 400; color: #52617b; }
@media (min-width: 901px) and (min-height: 680px) {
  body.home-page .site-footer { flex-basis: 58px; padding: 7px 16px 6px; }
  body.home-page .site-footer nav { margin-bottom: 4px; gap: 16px; }
  body.home-page .site-footer p { font-size: inherit; }
}


/* Final footer typography lock: copyright text must match footer navigation links exactly. */
.site-footer nav a,
.site-footer p {
  font-size: 12px !important;
  line-height: 1.35 !important;
}

/* Explicit copyright sizing: match compact footer navigation text. */
html body footer.site-footer > p { font-size:12px !important; line-height:1.35 !important; font-weight:400 !important; }


/* Homepage: allow normal vertical scrolling on desktop */
@media (min-width: 901px) and (min-height: 680px) {
  html, body.home-page {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  body.home-page {
    height: auto !important;
    min-height: 100vh !important;
  }
  body.home-page .books {
    flex: 0 0 auto !important;
  }
}


/* WeChat Channels QR popup */
.wechat-qr-overlay[hidden] { display: none !important; }
.wechat-qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 24, 48, .62);
}
.wechat-qr-dialog {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px 24px 24px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(0,0,0,.24);
  text-align: center;
}
.wechat-qr-dialog h2 {
  margin: 0 32px 10px;
  color: #18345b;
  font-size: 19px;
  line-height: 1.35;
}
.wechat-qr-dialog p {
  margin: 0 0 16px;
  color: #555;
  font-size: 14px;
  line-height: 1.5;
}
.wechat-qr-dialog > img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(68vh, 760px);
  object-fit: contain;
  margin: 0 auto;
}
.wechat-qr-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f1f3f6;
  color: #24364f;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
body.wechat-qr-open { overflow: hidden; }


/* ==========================================================================
   INNER PAGE CONTENT WIDTH STANDARD — 1240px DESKTOP
   Homepage remains unchanged. Inner-page content is centered and expanded
   from the previous 1120px frame; mobile gutters and responsive grids remain.
   ========================================================================== */
@media (min-width: 701px) {
  body.edu-page .edu-main,
  body.ai-page .ai-main,
  body.about-page main,
  body.contact-page .contact-main,
  body.car-page main,
  body.topic-page .topic-main,
  body.nf-page .nf-main {
    width: min(1240px, calc(100% - 64px)) !important;
    max-width: 1240px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  body.edu-page .edu-main,
  body.ai-page .ai-main {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.about-page .about-intro,
  body.about-page .about-section,
  body.about-page .about-closing,
  body.about-page .about-compact-banner,
  body.about-page .page-back-wrap {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.edu-page .edu-main > .about-compact-banner,
  body.ai-page .ai-main > .about-compact-banner,
  body.contact-page .contact-main > .about-compact-banner,
  body.books-page .books-main > .about-compact-banner {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.edu-page .edu-main > .page-back-wrap,
  body.ai-page .ai-main > .page-back-wrap {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.topic-page .topic-main {
    padding-left: 26px;
    padding-right: 26px;
  }

  body.nf-page .nf-main {
    padding-left: 26px;
    padding-right: 26px;
  }
}

@media (min-width: 701px) and (max-width: 1303px) {
  body.edu-page .edu-main,
  body.ai-page .ai-main,
  body.about-page main,
  body.contact-page .contact-main,
  body.car-page main,
  body.topic-page .topic-main,
  body.nf-page .nf-main {
    width: calc(100% - 48px) !important;
  }
}


/* ==========================================================================
   SHARED TOPIC / DETAIL BANNER — Family Members reference
   Used by AI Knowledge Classroom episode detail pages.
   Keep typography and geometry centralized here, not in page-level styles.
   ========================================================================== */
body.ai-page .ai-detail-hero {
  min-height: 175px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 46px;
  margin: 14px 0 30px;
  border-radius: 24px;
  background: linear-gradient(112deg, #dff3ff, #eaf0ff 58%, #fff1d8);
  border: 1px solid #d8e8f8;
}
body.ai-page .ai-detail-hero .ai-kicker {
  margin: 0 0 12px;
  color: #2676b7;
  font-family: var(--font-site);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.3;
  text-transform: uppercase;
}
body.ai-page .ai-detail-hero h1 {
  margin: 0 0 10px;
  color: #123d75;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: clamp(29px, 3.2vw, 38px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.025em;
}
body.ai-page .ai-detail-hero > p:not(.ai-kicker) {
  max-width: 850px;
  margin: 0;
  color: #405875;
  font-family: var(--font-site);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}
@media (max-width: 760px) {
  body.ai-page .ai-detail-hero {
    min-height: 150px;
    padding: 20px;
    margin: 12px 0 24px;
    border-radius: 17px;
  }
  body.ai-page .ai-detail-hero h1 {
    font-size: 25px;
  }
  body.ai-page .ai-detail-hero > p:not(.ai-kicker) {
    font-size: 13px;
  }
}



/* ==========================================================================
   KIWI INNER LEAF-PAGE BANNER — CANONICAL STANDARD
   Source of truth: Number Families banner. Reuse on every deepest/last-level page.
   ========================================================================== */
.topic-banner {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 0 var(--topic-banner-gap-bottom) !important;
  padding: var(--topic-banner-padding-y) var(--topic-banner-padding-x) !important;
  border: 1px solid #d8e8f8 !important;
  border-radius: var(--topic-banner-radius) !important;
  box-sizing: border-box !important;
  background: linear-gradient(112deg,#dff3ff,#eaf0ff 58%,#fff1d8) !important;
  background-image: linear-gradient(112deg,#dff3ff,#eaf0ff 58%,#fff1d8) !important;
}
.topic-banner-kicker {
  margin: 0 0 12px !important;
  color: #2676b7 !important;
  font-family: var(--font-site) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: .14em !important;
  line-height: normal !important;
  text-transform: uppercase !important;
}
.topic-banner h1 {
  margin: 0 0 14px !important;
  color: #123d75 !important;
  font-family: "Segoe UI",Tahoma,sans-serif !important;
  font-size: clamp(32px,4vw,50px) !important;
  font-weight: 700 !important;
  line-height: 1.08 !important;
  letter-spacing: -.03em !important;
}
.topic-banner-subtitle {
  max-width: 850px !important;
  margin: 0 !important;
  color: #405875 !important;
  font-family: "Segoe UI",Tahoma,sans-serif !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 1.7 !important;
  letter-spacing: normal !important;
}
@media (max-width:760px) {
  .topic-banner {
    padding: var(--topic-banner-padding-y) var(--topic-banner-padding-x) !important;
  }
  .topic-banner h1 { font-size: clamp(28px,7vw,36px) !important; }
  .topic-banner-subtitle { font-size: 15px !important; }
}



/* SHARED LEAF-PAGE BANNER — exact Number Families reference styling */
.nf-hero.topic-banner {
  position: relative;
  overflow: hidden;
  padding: var(--topic-banner-padding-y) var(--topic-banner-padding-x);
  border-radius: var(--topic-banner-radius);
  background: linear-gradient(112deg,#dff3ff,#eaf0ff 58%,#fff1d8);
  border: 1px solid #d8e8f8;
  margin: 29px 0 var(--topic-banner-gap-bottom);
  box-sizing: border-box;
  height: auto;
  min-height: 0;
  max-height: none;
}
.nf-hero.topic-banner .nf-kicker,
.nf-hero.topic-banner .topic-banner-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  color: #2676b7;
  margin: 0 0 12px;
  text-transform: uppercase;
  line-height: normal;
}
.nf-hero.topic-banner h1 {
  font-size: clamp(32px,4vw,50px);
  line-height: 1.08;
  color: #123d75;
  margin: 0 0 14px;
  letter-spacing: -.03em;
  font-family: "Segoe UI",Tahoma,sans-serif;
  font-weight: 700;
}
.nf-hero.topic-banner > p:last-child {
  max-width: 850px;
  color: #405875;
  font-size: 18px;
  line-height: 1.7;
  margin: 0;
  font-family: "Segoe UI",Tahoma,sans-serif;
  font-weight: 400;
}
@media (max-width:760px) {
  .nf-hero.topic-banner {
    padding: 26px 22px;
  }
  .nf-hero.topic-banner h1 { font-size: clamp(28px,7vw,36px); }
  .nf-hero.topic-banner > p:last-child { font-size: 15px; }
}


/* Episode 1 editorial cover image — keep it in the article flow, not full-width. */
.ai-content .ai-inline-cover {
  float: right;
  width: min(34%, 430px);
  max-width: 430px;
  margin: 0 0 22px 30px;
  padding: 0;
}
.ai-content .ai-inline-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}
@media (max-width: 760px) {
  .ai-content .ai-inline-cover {
    float: none;
    width: min(100%, 520px);
    max-width: 100%;
    margin: 0 auto 20px;
  }
}


/* Episode detail navigation — restored from the existing AI episode-page pattern. */
.ai-bottom-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--ai-line);
  padding-top: 22px;
  margin-top: 42px;
}
.ai-bottom-nav a {
  color: #1768b2;
  font-weight: 800;
  text-decoration: none;
}
.ai-footer-note {
  text-align: center;
  color: #718098;
  font-size: 12px;
  margin-top: 32px;
}

/* Episode cover image — same inline-right treatment used by the other AI episode pages. */
.ai-inline-cover {
  float: right;
  width: 31%;
  max-width: 360px;
  min-width: 210px;
  margin: 4px 24px 16px 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 5px 18px rgba(24,55,95,.10);
}
.ai-inline-cover.ai-cover-right {
  float: right;
  margin: 4px 0 16px 24px;
}
.ai-inline-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 14px;
}
.ai-content:after {
  content: "";
  display: block;
  clear: both;
}
@media(max-width:600px) {
  .ai-inline-cover,
  .ai-inline-cover.ai-cover-right {
    float: none;
    width: min(68%,320px);
    min-width: 0;
    max-width: 320px;
    margin: 8px auto 22px;
  }
}

/* Episode 1 banner: use the exact final Number Families banner geometry and type scale.
   This overrides the earlier generic topic-banner rules without changing page content. */
body.ai-page .ai-main > .nf-hero.topic-banner {
  position: relative !important;
  overflow: visible !important;
  width: 100% !important;
  height: auto !important;
  min-height: 150px !important;
  max-height: none !important;
  padding: 24px 46px !important;
  border: 1px solid #d8e8f8 !important;
  border-radius: 24px !important;
  margin: 14px 0 34px !important;
  box-sizing: border-box !important;
  display: block !important;
  background: linear-gradient(112deg,#dff3ff,#eaf0ff 58%,#fff1d8) !important;
  background-image: linear-gradient(112deg,#dff3ff,#eaf0ff 58%,#fff1d8) !important;
}
body.ai-page .ai-main > .nf-hero.topic-banner > .topic-banner-kicker {
  margin: 0 0 12px !important;
  color: #2676b7 !important;
  font-family: var(--font-site) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: .14em !important;
  line-height: normal !important;
  text-transform: uppercase !important;
}
body.ai-page .ai-main > .nf-hero.topic-banner > h1 {
  margin: 0 0 14px !important;
  color: #123d75 !important;
  font-family: "Segoe UI",Tahoma,sans-serif !important;
  font-size: clamp(29px,3.2vw,38px) !important;
  font-weight: 700 !important;
  line-height: 1.12 !important;
  letter-spacing: -.025em !important;
}
body.ai-page .ai-main > .nf-hero.topic-banner > p:last-child {
  max-width: 850px !important;
  margin: 0 !important;
  color: #405875 !important;
  font-family: "Segoe UI",Tahoma,sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}
@media(max-width:760px) {
  body.ai-page .ai-main > .nf-hero.topic-banner {
    height: auto !important;
    min-height: 150px !important;
    max-height: none !important;
    padding: 24px 23px !important;
    margin: 14px 0 34px !important;
  }
  body.ai-page .ai-main > .nf-hero.topic-banner > h1 {
    font-size: 29px !important;
  }
}


/* ==========================================================================
   CANONICAL LEAF-PAGE BANNER — exact Number Families reference
   Applied to all deepest/detail pages. Change text only; do not alter layout.
   ========================================================================== */
html body main .nf-hero.topic-banner {
  position: relative !important;
  overflow: visible !important;
  width: 100% !important;
  height: auto !important;
  min-height: 150px !important;
  max-height: none !important;
  padding: 24px 46px !important;
  margin: 14px 0 34px !important;
  border: 1px solid #d8e8f8 !important;
  border-radius: 24px !important;
  box-sizing: border-box !important;
  display: block !important;
  background: linear-gradient(112deg,#dff3ff,#eaf0ff 58%,#fff1d8) !important;
  background-image: linear-gradient(112deg,#dff3ff,#eaf0ff 58%,#fff1d8) !important;
}
html body main .nf-hero.topic-banner > .topic-banner-kicker {
  margin: 0 0 12px !important;
  color: #2676b7 !important;
  font-family: var(--font-site) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: .14em !important;
  line-height: normal !important;
  text-transform: uppercase !important;
}
html body main .nf-hero.topic-banner > h1 {
  margin: 0 0 14px !important;
  color: #123d75 !important;
  font-family: "Segoe UI",Tahoma,sans-serif !important;
  font-size: clamp(29px,3.2vw,38px) !important;
  font-weight: 700 !important;
  line-height: 1.12 !important;
  letter-spacing: -.025em !important;
}
html body main .nf-hero.topic-banner > p:last-child {
  max-width: 850px !important;
  margin: 0 !important;
  color: #405875 !important;
  font-family: "Segoe UI",Tahoma,sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}
@media(max-width:760px) {
  html body main .nf-hero.topic-banner {
    height: auto !important;
    min-height: 150px !important;
    max-height: none !important;
    padding: 24px 23px !important;
    margin: 14px 0 34px !important;
  }
  html body main .nf-hero.topic-banner > h1 {
    font-size: 29px !important;
  }
}


/* Leaf-page banner text limits: one-line title, maximum two-line subtitle. */
html body main .nf-hero.topic-banner {
  height: auto !important;
  min-height: 150px !important;
  max-height: none !important;
  padding: 24px 46px !important;
}
html body main .nf-hero.topic-banner > h1 {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}
html body main .nf-hero.topic-banner > p:last-child {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  overflow: hidden !important;
  max-height: 3.2em !important;
}
@media(max-width:760px) {
  html body main .nf-hero.topic-banner {
    height: auto !important;
    min-height: 150px !important;
    max-height: none !important;
    padding: 24px 23px !important;
  }
  html body main .nf-hero.topic-banner > h1 {
    font-size: clamp(20px, 3.2vw, 29px) !important;
  }
}


/* Higher-specificity override for the Episode 1 banner rule: allow up to two subtitle lines without clipping. */
html body.ai-page main.ai-main > .nf-hero.topic-banner {
  height: auto !important;
  min-height: 150px !important;
  max-height: none !important;
  padding: 24px 46px !important;
}
html body.ai-page main.ai-main > .nf-hero.topic-banner > h1 {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
html body.ai-page main.ai-main > .nf-hero.topic-banner > p:last-child {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  overflow: hidden !important;
  max-height: 3.2em !important;
}
@media(max-width:760px) {
  html body.ai-page main.ai-main > .nf-hero.topic-banner {
    height: auto !important;
    min-height: 150px !important;
    max-height: none !important;
    padding: 24px 23px !important;
  }
}


/* ==========================================================================
   FINAL CANONICAL LEAF-PAGE BANNER STANDARD — v2
   Reference: Number Families. This block is authoritative for every .topic-banner.
   Desktop: 38px title / 16px subtitle. Mobile: 29px title / 15px subtitle.
   The banner grows naturally to fit one title line and up to two subtitle lines.
   ========================================================================== */
html body main .nf-hero.topic-banner {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: auto !important;
  min-height: 150px !important;
  max-height: none !important;
  padding: 24px 46px !important;
  margin: 14px 0 34px !important;
  overflow: hidden !important;
  border: 1px solid #d8e8f8 !important;
  border-radius: 24px !important;
  background: linear-gradient(112deg, #dff3ff, #eaf0ff 58%, #fff1d8) !important;
  gap: 0 !important;
}
html body main .nf-hero.topic-banner > .topic-banner-kicker {
  display: block !important;
  flex: 0 0 auto !important;
  margin: 0 0 12px !important;
  padding: 0 !important;
  color: #2676b7 !important;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: .14em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}
html body main .nf-hero.topic-banner > h1 {
  display: block !important;
  flex: 0 0 auto !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  color: #123d75 !important;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
  font-size: 38px !important;
  font-weight: 700 !important;
  line-height: 1.12 !important;
  letter-spacing: -.025em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}
html body main .nf-hero.topic-banner > p:last-child {
  display: -webkit-box !important;
  flex: 0 0 auto !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  max-width: 850px !important;
  max-height: 3.2em !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  color: #405875 !important;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}
@media (max-width: 760px) {
  html body main .nf-hero.topic-banner {
    height: auto !important;
    min-height: 150px !important;
    max-height: none !important;
    padding: 24px 23px !important;
  }
  html body main .nf-hero.topic-banner > h1 {
    font-size: 29px !important;
    line-height: 1.12 !important;
  }
  html body main .nf-hero.topic-banner > p:last-child {
    font-size: 15px !important;
    line-height: 1.55 !important;
    max-height: 3.1em !important;
  }
}


/* ==========================================================================
   FINAL CANONICAL LEAF-PAGE BANNER STANDARD — v3
   Authoritative final override for every deepest-level page banner.
   Slightly smaller title + taller line box prevent descender clipping.
   ========================================================================== */
html body main .nf-hero.topic-banner {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: auto !important;
  min-height: 150px !important;
  max-height: none !important;
  padding: 24px 46px !important;
  margin: 14px 0 34px !important;
  overflow: hidden !important;
  border: 1px solid #d8e8f8 !important;
  border-radius: 24px !important;
  background: linear-gradient(112deg, #dff3ff, #eaf0ff 58%, #fff1d8) !important;
}
html body main .nf-hero.topic-banner > .topic-banner-kicker {
  display: block !important;
  flex: 0 0 auto !important;
  margin: 0 0 12px !important;
  padding: 0 !important;
  color: #2676b7 !important;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: .14em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}
html body main .nf-hero.topic-banner > h1 {
  display: block !important;
  flex: 0 0 auto !important;
  margin: 0 0 12px !important;
  padding: 2px 0 3px !important;
  color: #123d75 !important;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
  font-size: 36px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  letter-spacing: -.025em !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: 100% !important;
}
html body main .nf-hero.topic-banner > p:last-child {
  display: -webkit-box !important;
  flex: 0 0 auto !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  max-width: 850px !important;
  max-height: 3.2em !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  color: #405875 !important;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}
@media (max-width: 760px) {
  html body main .nf-hero.topic-banner {
    height: auto !important;
    min-height: 150px !important;
    max-height: none !important;
    padding: 24px 23px !important;
  }
  html body main .nf-hero.topic-banner > h1 {
    font-size: 28px !important;
    line-height: 1.25 !important;
  }
  html body main .nf-hero.topic-banner > p:last-child {
    font-size: 15px !important;
    line-height: 1.55 !important;
    max-height: 3.1em !important;
  }
}


/* Episode 1 learning visuals — compact, bilingual and responsive. */
.ai-visual-panel {
  clear: both;
  margin: 22px 0 28px;
  padding: 18px 20px;
  border: 1px solid #dbe8f7;
  border-radius: 18px;
  background: #f8fbff;
}
.ai-visual-heading {
  margin: 0 0 14px;
  color: #123d75;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.3;
}
.ai-flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.ai-flow-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  padding: 13px 10px;
  border-radius: 14px;
  background: #edf6ff;
}
.ai-flow-icon, .ai-example-art, .ai-compare-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ai-flow-icon svg { width: 54px; height: 54px; }
.ai-flow-item strong { color: #123d75; font-size: 15px; }
.ai-flow-item small { color: #506782; font-size: 12px; line-height: 1.4; }
.ai-flow-arrow { color: #3988c8; font-size: 25px; font-weight: 700; }
.ai-flow-result { background: #fff5df; }
.ai-flow-symbol { display: grid; place-items: center; width: 54px; height: 54px; color: #d98a2b; font-size: 42px; }
.ai-visual-caption { margin: 12px 0 0; color: #5b7088; font-size: 13px; text-align: center; }
.ai-brand-row { display: grid; grid-template-columns: repeat(3,1fr) 1.5fr; gap: 10px; align-items: stretch; }
.ai-brand-chip, .ai-brand-conclusion {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 74px; padding: 12px; border-radius: 13px; background: #edf6ff; text-align: center;
}
.ai-brand-chip b { color: #123d75; font-size: 18px; }
.ai-brand-chip span { margin-top: 3px; color: #60748a; font-size: 12px; }
.ai-brand-conclusion { background: #fff4df; color: #7a5518; font-size: 14px; }
.ai-example-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.ai-example-card {
  padding: 15px; border-radius: 15px; background: #fff;
  border: 1px solid #e1ebf7; text-align: center;
}
.ai-example-art svg { width: 74px; height: 64px; }
.ai-example-card strong { display: block; margin: 5px 0; color: #123d75; font-size: 15px; }
.ai-example-card p { margin: 0; color: #536a82; font-size: 13px; line-height: 1.5; }
.ai-compare-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.ai-compare-card {
  display: flex; align-items: center; gap: 14px; padding: 15px;
  border-radius: 15px; background: #eaf4ff;
}
.ai-compare-card.ai-creative { background: #fff3e3; }
.ai-compare-icon svg { width: 62px; height: 62px; flex: 0 0 auto; }
.ai-compare-card strong { color: #123d75; font-size: 15px; }
.ai-compare-card p { margin: 4px 0 0; color: #536a82; font-size: 13px; line-height: 1.5; }
.ai-check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.ai-check-card {
  display: grid; grid-template-columns: 58px 1fr; column-gap: 12px; align-items: center;
  padding: 15px; border: 1px solid #e1ebf7; border-radius: 15px; background: #fff;
}
.ai-check-card span { grid-row: span 2; }
.ai-check-card svg { width: 58px; height: 58px; }
.ai-check-card strong { color: #123d75; font-size: 15px; }
.ai-check-card p { margin: 3px 0 0; color: #536a82; font-size: 13px; line-height: 1.5; }
.ai-capability-strip {
  display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px;
}
.ai-capability-strip > div {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 12px 6px; border-radius: 13px; background: #edf6ff; text-align: center;
}
.ai-capability-strip > div:nth-child(2n) { background: #fff4e3; }
.ai-capability-strip span { color: #2676b7; font-size: 25px; font-weight: 800; line-height: 1; }
.ai-capability-strip strong { color: #123d75; font-size: 13px; }
@media (max-width: 760px) {
  .ai-visual-panel { margin: 18px 0 22px; padding: 14px; }
  .ai-visual-heading { font-size: 16px; }
  .ai-flow-diagram { gap: 5px; }
  .ai-flow-item { padding: 10px 5px; }
  .ai-flow-icon svg { width: 42px; height: 42px; }
  .ai-flow-arrow { font-size: 18px; }
  .ai-flow-item small { font-size: 10px; }
  .ai-brand-row { grid-template-columns: repeat(3,1fr); }
  .ai-brand-conclusion { grid-column: 1 / -1; min-height: 52px; }
  .ai-example-grid { grid-template-columns: 1fr; }
  .ai-example-card { display: grid; grid-template-columns: 74px 1fr; text-align: left; align-items: center; }
  .ai-example-art { grid-row: span 2; }
  .ai-example-card p { margin-top: 2px; }
  .ai-compare-grid, .ai-check-grid { grid-template-columns: 1fr; }
  .ai-capability-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
}


/* Episode 1 misconception prompts: make each key idea easy to scan. */
.ai-content p.misconception-lead {
  margin: 26px 0 8px;
  padding: 11px 15px;
  border-left: 4px solid #5aa6dc;
  border-radius: 0 12px 12px 0;
  background: #f0f7ff;
  color: #123d75;
  font-weight: 700;
  line-height: 1.5;
}
.ai-content p.misconception-lead strong {
  display: inline-block;
  margin-right: 5px;
  color: #2676b7;
}
.ai-content h2 {
  margin-top: 34px;
}
.ai-content .ai-definition {
  padding: 17px 20px;
  border-left: 4px solid #2676b7;
  border-radius: 0 14px 14px 0;
  background: #eff6ff;
}

/* About: hometown story */
.hometown-section .hometown-list{display:grid;gap:22px;margin-top:24px}
.hometown-item{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);align-items:center;gap:26px;padding:18px;border:1px solid #e1e9f3;border-radius:18px;background:#fff;box-shadow:0 5px 20px rgba(24,57,92,.045)}
.hometown-item:nth-child(even) .hometown-photo{order:2}
.hometown-photo img{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:contain;border-radius:12px;background:#f3f7fb}
.hometown-copy h3{font-size:clamp(1.15rem,2vw,1.5rem);color:#153b69;margin:0 0 12px}
.hometown-copy p{line-height:1.8;margin:0;color:#35485c}
.hometown-copy .hometown-note{font-size:.78rem;color:#65758b;margin-top:9px}
.hometown-source{display:inline-block;margin-top:12px;font-size:.82rem;color:#235e9b;text-decoration:underline;text-underline-offset:3px}
.hometown-closing{margin:26px auto 0;max-width:850px;line-height:1.8;text-align:center;color:#35485c}
@media(max-width:760px){.hometown-item{grid-template-columns:1fr;gap:15px;padding:12px}.hometown-item:nth-child(even) .hometown-photo{order:0}.hometown-copy{padding:3px 5px 8px}}

/* Yiai Lake: edge-to-edge photo inside its card, with rounded outer corners. */
@media(max-width:760px){
}

/* Yiai photo uses same inset rounded image card as other hometown entries */

/* Yiai Lake: retain independent inset card; fit native 2:1 image without letterboxing. */
.hometown-photo img[src$="yiai-lake.webp"]{aspect-ratio:2 / 1;object-fit:cover;background:transparent;}

/* Huanggang Mijuan: show full original artwork without side letterboxing.
   Applies to both Chinese and English versions. */
.hometown-photo img[src$="huanggang-mijuan-en.webp"],
.hometown-photo img[src$="huanggang-mijuan.webp"]{aspect-ratio:auto;object-fit:contain;background:transparent;}

/* 2026-11-09 — Level 4 body width parity with Math Foundations Decimal.
   The old topic-main calc(100% - 64px) plus inner padding narrowed
   Number Families and all Mathematical Thinking lessons. */
@media (min-width: 701px) {
  html body.topic-page main.topic-main {
    width: 100% !important;
    max-width: 1240px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 34px !important;
    padding-right: 34px !important;
    box-sizing: border-box !important;
  }
}
@media (max-width: 700px) {
  html body.topic-page main.topic-main {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
    box-sizing: border-box !important;
  }
}


/* 2026-11-09 FINAL: Level 4 topic-main matches Decimal edu-main exactly.
   Both use the same outer width, with ZERO extra internal horizontal padding.
   Prior 34px topic-main padding was the cause of the visible narrowing. */
@media (min-width: 701px) {
  html body.topic-page main.topic-main {
    width: min(1240px, calc(100% - 64px)) !important;
    max-width: 1240px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
  }
}
@media (min-width: 701px) and (max-width: 1303px) {
  html body.topic-page main.topic-main {
    width: calc(100% - 48px) !important;
  }
}
@media (max-width: 700px) {
  html body.topic-page main.topic-main {
    width: calc(100% - 36px) !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }
}

/* 2026-11-09: Level 4 inner layout must align exactly with its topic banner.
   Mathematical Thinking previously capped its grid at 1160px within a 1240px banner.
   Number Families and all other topic pages share this full-width rule. */
@media (min-width: 701px) {
  html body.topic-page main.topic-main > .kiwi-learning-layout,
  html body.topic-page main.topic-main > .nf-lesson-layout {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }
}
@media (max-width: 700px) {
  html body.topic-page main.topic-main > .kiwi-learning-layout,
  html body.topic-page main.topic-main > .nf-lesson-layout {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }
}

/* Grade labels (data/math-topics.json via kiwi_math_catalog.py) */
.kiwi-grade-strip-wrap {
  margin: 14px 0 6px;
}
.kiwi-grade-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #5e6f88;
}
.kiwi-grade-strip--hub {
  margin: 12px 0 0;
}
/* Metadata chips — not buttons (border + muted fill, regular weight) */
.kiwi-grade-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  background: #f6f9fc;
  border: 1px solid #d4e0ee;
  color: #4a627c;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  cursor: default;
  user-select: none;
}
a.kiwi-grade-pill--link {
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
a.kiwi-grade-pill--link:hover,
a.kiwi-grade-pill--link:focus-visible {
  background: #eaf3ff;
  border-color: #b8d4f0;
  color: #155d9d;
  outline-offset: 2px;
}
.kiwi-grade-pill--course {
  background: #faf7f1;
  border-color: #e5dcc8;
  color: #6b5a3a;
  font-weight: 500;
}
a.kiwi-grade-pill--course.kiwi-grade-pill--link:hover,
a.kiwi-grade-pill--course.kiwi-grade-pill--link:focus-visible {
  background: #f5ecd8;
  border-color: #d9c9a8;
  color: #5c4a28;
}
.kiwi-grade-hub-link {
  color: #1768b2;
  font-weight: 500;
  text-decoration: none;
  font-size: 13px;
  margin-left: 2px;
}
.kiwi-grade-hub-link:hover {
  text-decoration: underline;
}
.kiwi-grade-strand {
  margin: 28px 0 12px;
  font-size: 20px;
  color: #153d70;
}

/* Mathematical Thinking (thinking-*): topic title aligns with sidebar like foundation-decimal */
html body.topic-page .kiwi-learning-layout {
  align-items: start;
}
html body.topic-page .kiwi-topic-article > h1.kiwi-current-topic {
  font-size: clamp(23px, 2.6vw, 30px);
  line-height: 1.25;
  color: #153d70;
  border-bottom: 2px solid #e5f2ff;
  padding-bottom: 12px;
  margin: 0 0 22px;
}
html body.topic-page .kiwi-topic-article > .nf-section:first-of-type,
html body.topic-page .kiwi-topic-article > .word-topic:first-of-type {
  margin-top: 0;
}

/* Math Foundations (mf-article) + Mathematical Thinking (kiwi-topic-article): H4 / H5 hierarchy */
.mf-article h4,
.kiwi-topic-article h4 {
  font-size: 16px;
  font-weight: 750;
  color: #173e70;
  margin: 20px 0 8px;
}
.mf-article h5,
.kiwi-topic-article h5 {
  font-size: 15px;
  font-weight: 650;
  color: #1768b2;
  margin: 12px 0 6px 3ch;
  line-height: 1.5;
}
.mf-article .lesson-card-content h4,
.kiwi-topic-article .lesson-card-content h4,
.kiwi-topic-article .lesson-card-body h4 {
  color: #153d70;
  font-size: 16px;
  font-weight: 750;
  margin: 20px 0 8px;
}
.mf-article .lesson-card-content h5,
.kiwi-topic-article .lesson-card-content h5,
.kiwi-topic-article .lesson-card-body h5 {
  font-size: 15px;
  font-weight: 650;
  color: #1768b2;
  margin: 12px 0 6px;
  padding-left: 3ch;
  line-height: 1.5;
}
/* H5 sub-section: title + following siblings share the same 3ch left edge */
.mf-article .lesson-card-content > h5 ~ :where(p, ol, div, aside),
.kiwi-topic-article .lesson-card-content > h5 ~ :where(p, ol, div, aside),
.kiwi-topic-article .lesson-card-body > h5 ~ :where(p, ol, div, aside) {
  margin-left: 0;
  padding-left: 3ch;
  max-width: 100%;
  box-sizing: border-box;
}
/* Example(s) ladder under h5: label 3ch → item 6ch → steps 9ch (see Method 2) */
.mf-article .lesson-card-content > h5 ~ ul.kiwi-example-list,
.kiwi-topic-article .lesson-card-content > h5 ~ ul.kiwi-example-list {
  margin: 0.5rem 0 1rem 3ch;
  padding-left: 3ch;
  list-style: disc outside;
  text-align: left;
}
.mf-article .lesson-card-content > h5 ~ p.kiwi-single-example,
.kiwi-topic-article .lesson-card-content > h5 ~ p.kiwi-single-example {
  padding-left: 6ch;
}
.mf-article .lesson-card-content > h5 ~ ol.kiwi-example-steps,
.kiwi-topic-article .lesson-card-content > h5 ~ ol.kiwi-example-steps {
  margin: 0.35rem 0 0.6rem;
  padding-left: 9ch;
  list-style-type: decimal;
  list-style-position: inside;
  text-align: left;
}
.mf-article .lesson-card-content > h5 ~ ul.kiwi-example-list > li > ol.kiwi-example-steps,
.kiwi-topic-article .lesson-card-content > h5 ~ ul.kiwi-example-list > li > ol.kiwi-example-steps {
  margin: 0.35rem 0 0.6rem 3ch !important;
  padding-left: 0 !important;
}
.mf-article .lesson-card-content > h5 ~ ul:not(.kiwi-example-list),
.kiwi-topic-article .lesson-card-content > h5 ~ ul:not(.kiwi-example-list) {
  margin-left: 3ch;
  padding-left: 3ch;
  list-style: disc outside;
}
.mf-article .lesson-card-content > h5 ~ ul.kiwi-example-list > li > :first-child,
.kiwi-topic-article .lesson-card-content > h5 ~ ul.kiwi-example-list > li > :first-child {
  display: inline;
}
.mf-article .lesson-card-content > h5 ~ ul.kiwi-example-list > li > p:first-child,
.kiwi-topic-article .lesson-card-content > h5 ~ ul.kiwi-example-list > li > p:first-child {
  display: inline;
  margin: 0;
  padding: 0;
}

/* Math Foundations import pages (foundation-*): match number-families — no card frame on the article column. */
html body.topic-page main.edu-main > .foundation-level4 .mf-article.mf-chapter {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
@media (min-width: 701px) {
  html body.edu-page.topic-page main.edu-main {
    width: min(1240px, calc(100% - 64px)) !important;
    max-width: 1240px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  html body.edu-page.topic-page main.edu-main > .foundation-level4 {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}
@media (min-width: 701px) and (max-width: 1303px) {
  html body.edu-page.topic-page main.edu-main {
    width: calc(100% - 48px) !important;
  }
}
@media (max-width: 700px) {
  html body.edu-page.topic-page main.edu-main {
    width: calc(100% - 36px) !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* Level 4 topic banner: content-driven height on desktop and mobile.
   No clipping, line clamp or fixed height; mobile headings may wrap. */
html body main .nf-hero.topic-banner,
html body.ai-page main.ai-main > .nf-hero.topic-banner {
  height: auto !important;
  min-height: 150px !important;
  max-height: none !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}
html body main .nf-hero.topic-banner > h1,
html body.ai-page main.ai-main > .nf-hero.topic-banner > h1 {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  max-height: none !important;
}
html body main .nf-hero.topic-banner > p:last-child,
html body.ai-page main.ai-main > .nf-hero.topic-banner > p:last-child {
  display: block !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  -webkit-box-orient: initial !important;
  overflow: visible !important;
  max-height: none !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
}
@media (max-width: 760px) {
  html body main .nf-hero.topic-banner,
  html body.ai-page main.ai-main > .nf-hero.topic-banner {
    height: auto !important;
    min-height: 150px !important;
    max-height: none !important;
    padding: 24px 23px !important;
  }
}


/* Level 4 responsive banner: 2026-11-09. Keep every text node inside the rounded panel. */
html body.topic-page main .nf-hero.topic-banner,
html body main .nf-hero.topic-banner,
html body main .nf-hero.topic-banner.foundation-topic-banner {
  display: block !important; position: relative !important;
  box-sizing: border-box !important; width: 100% !important;
  height: auto !important; min-height: 150px !important;
  max-height: none !important; overflow: visible !important;
  padding: 24px 38px !important;
}
html body main .nf-hero.topic-banner > .topic-banner-kicker {
  position: static !important; display: block !important;
  width: auto !important; max-width: 100% !important;
  white-space: normal !important; overflow-wrap: break-word !important;
  overflow: visible !important; text-overflow: clip !important;
  margin: 0 0 12px !important;
}
html body main .nf-hero.topic-banner > h1 {
  position: static !important; display: block !important;
  white-space: normal !important; overflow-wrap: break-word !important;
  overflow: visible !important; text-overflow: clip !important;
  max-height: none !important;
}
html body main .nf-hero.topic-banner > .topic-banner-subtitle,
html body main .nf-hero.topic-banner > p:last-child {
  position: static !important; display: block !important;
  white-space: normal !important; overflow-wrap: break-word !important;
  overflow: visible !important; max-height: none !important;
  -webkit-line-clamp: unset !important; line-clamp: unset !important;
  margin-bottom: 0 !important;
}
@media (max-width: 700px) {
  html body.topic-page main .nf-hero.topic-banner,
  html body main .nf-hero.topic-banner,
  html body main .nf-hero.topic-banner.foundation-topic-banner {
    height: auto !important; min-height: 150px !important;
    max-height: none !important; overflow: visible !important;
    padding: 22px 22px 25px !important;
  }
  html body main .nf-hero.topic-banner > .topic-banner-kicker {
    font-size: 11px !important; line-height: 1.45 !important;
    letter-spacing: .10em !important;
  }
  html body main .nf-hero.topic-banner > h1 {
    font-size: clamp(25px, 7vw, 29px) !important;
    line-height: 1.25 !important;
  }
  html body main .nf-hero.topic-banner > .topic-banner-subtitle,
  html body main .nf-hero.topic-banner > p:last-child {
    font-size: 15px !important; line-height: 1.55 !important;
  }
}

/* Mobile: compact inner banners — match topic-banner frame (main gutter + 22px text inset). */
@media (max-width: 700px) {
  html body:not(.home-page) main > :is(.compact-page-banner, .about-compact-banner),
  html body.edu-page .edu-main > .about-compact-banner,
  html body.ai-page .ai-main > .about-compact-banner,
  html body.about-page main > .about-compact-banner,
  html body.contact-page .contact-main > .about-compact-banner,
  html body.books-page main > .about-compact-banner,
  html body.books-page .books-main > .about-compact-banner,
  html body.in-class-page main > .about-compact-banner,
  html body:not(.home-page) main > .page-banner,
  html body:not(.home-page) main > .contact-banner,
  html body:not(.home-page) main > .legal-banner {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: var(--topic-banner-padding-x, 22px) !important;
    padding-right: var(--topic-banner-padding-x, 22px) !important;
    box-sizing: border-box !important;
  }
}

/* Mobile: all inner-page banners grow with title + subtitle (Levels 2–4). */
@media (max-width: 760px) {
  html body:not(.home-page) main .compact-page-banner,
  html body:not(.home-page) main .about-compact-banner,
  html body:not(.home-page) main .page-banner,
  html body:not(.home-page) main .contact-banner,
  html body:not(.home-page) main .legal-banner,
  html body:not(.home-page) main .book-page-banner,
  html body:not(.home-page) main .book-compact-banner {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    align-content: center !important;
    align-items: center !important;
    justify-items: start !important;
    height: auto !important;
    min-height: var(--inner-banner-height-mobile, 150px) !important;
    max-height: none !important;
    overflow: visible !important;
  }
  html body:not(.home-page) main .about-compact-banner .compact-banner-copy {
    align-self: center !important;
    justify-self: start !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  html body:not(.home-page) main .about-compact-banner h1,
  html body:not(.home-page) main .compact-page-banner h1 {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  html body:not(.home-page) main .about-compact-banner .compact-banner-subtitle,
  html body:not(.home-page) main .compact-page-banner .compact-banner-subtitle,
  html body:not(.home-page) main .compact-page-banner .buy-subtitle {
    display: block !important;
    white-space: normal !important;
    overflow: visible !important;
    max-height: none !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
  }
}

/* ==========================================================================
   EDU / REAL-LIFE CONTENT — panels, formulas, tables (mobile-responsive)
   Canonical: math/skateboard-ramp.html. See DESIGN_STANDARDS.md §6.1.
   ========================================================================== */
body.edu-page .edu-two > * {
  min-width: 0;
}
body.edu-page .edu-panel {
  box-sizing: border-box;
  min-width: 0;
}
body.edu-page .edu-formula {
  font: clamp(20px, 5.2vw, 26px) Georgia, serif;
  text-align: center;
  padding: clamp(12px, 3vw, 18px) clamp(10px, 2.5vw, 16px);
  background: #f0f6fd;
  border-radius: 12px;
  color: #174c83;
  line-height: 1.35;
  word-break: break-word;
}
body.edu-page .edu-table-wrap,
.mf-article .edu-table-wrap {
  max-width: 100%;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}
.mf-article .edu-table-wrap {
  margin: 14px 0;
}
.mf-article .edu-table-wrap > .edu-table,
.mf-article .edu-table-wrap > table.edu-table {
  width: 100% !important;
  display: table !important;
  table-layout: fixed;
  margin: 0;
}
/* Full-width edu tables in lesson body (beats page-local table{display:block} scroll wrappers) */
.mf-article table.edu-table,
.kiwi-topic-article table.edu-table {
  display: table !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  border-collapse: collapse;
}
/* Compact rows — no display-math block margins inside table cells */
.mf-article .edu-table:not(.kiwi-edu-table-visual-compare) :is(th, td),
.kiwi-topic-article .edu-table:not(.kiwi-edu-table-visual-compare) :is(th, td) {
  padding: 5px 8px !important;
  vertical-align: middle;
  line-height: 1.3;
}
.mf-article .edu-table:not(.kiwi-edu-table-visual-compare) .kiwi-math-block,
.kiwi-topic-article .edu-table:not(.kiwi-edu-table-visual-compare) .kiwi-math-block {
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  min-height: 0;
}
.mf-article .edu-table:not(.kiwi-edu-table-visual-compare) :is(math[display="block"], math.math-display, .math-display),
.kiwi-topic-article .edu-table:not(.kiwi-edu-table-visual-compare) :is(math[display="block"], math.math-display, .math-display) {
  margin: 0 !important;
}
.mf-article .edu-table:not(.kiwi-edu-table-with-mnemonic) :is(thead th, tbody td, tbody th),
.kiwi-topic-article .edu-table:not(.kiwi-edu-table-with-mnemonic) :is(thead th, tbody td, tbody th) {
  text-align: left !important;
}
.mf-article .edu-table thead th,
.kiwi-topic-article .edu-table thead th {
  font-weight: 700 !important;
  background: #f3f8fe !important;
}
/* Row-column header tables — DESIGN_STANDARDS §6.3 */
.mf-article .edu-table.kiwi-edu-table-row-column-header thead th,
.kiwi-topic-article .edu-table.kiwi-edu-table-row-column-header thead th,
.mf-article .edu-table.kiwi-edu-table-row-column-header tbody > tr > :first-child,
.kiwi-topic-article .edu-table.kiwi-edu-table-row-column-header tbody > tr > :first-child {
  font-weight: 700 !important;
  background: #f3f8fe !important;
}
.mf-article .edu-table.kiwi-edu-table-row-column-header :is(thead th, tbody td, tbody th),
.kiwi-topic-article .edu-table.kiwi-edu-table-row-column-header :is(thead th, tbody td, tbody th) {
  text-align: left !important;
}
body.car-page .car-table.kiwi-edu-table-row-column-header thead th,
body.car-page .car-table.kiwi-edu-table-row-column-header tbody > tr > :first-child {
  font-weight: 700 !important;
  background: #f3f8fe !important;
}
body.edu-page .edu-table {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  border-collapse: collapse;
}
body.edu-page .edu-table th,
body.edu-page .edu-table td {
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* Mnemonic rule tables — cream .nf-note header + category bands (DESIGN_STANDARDS §6.2) */
.mf-article .edu-table.kiwi-edu-table-with-mnemonic,
.kiwi-topic-article .edu-table.kiwi-edu-table-with-mnemonic {
  border-collapse: separate;
  border-spacing: 0;
}
.mf-article .edu-table thead tr.kiwi-edu-table-mnemonic th,
.kiwi-topic-article .edu-table thead tr.kiwi-edu-table-mnemonic th {
  background: #fff8e8 !important;
  color: #b85f0c !important;
  text-align: center;
  vertical-align: middle;
  font-size: clamp(1rem, 2.4vw, 1.05rem);
  font-weight: 700;
  line-height: 1.65;
  padding: 14px 17px;
  border: 1px solid #f0dfad !important;
  border-bottom: 1px solid #dce6f1 !important;
  border-radius: 12px 12px 0 0;
}
.mf-article .edu-table thead tr.kiwi-edu-table-mnemonic th strong,
.kiwi-topic-article .edu-table thead tr.kiwi-edu-table-mnemonic th strong {
  font-weight: 700;
  color: #b85f0c !important;
}
.mf-article .edu-table.kiwi-edu-table-with-mnemonic tbody > tr > th[colspan="3"],
.kiwi-topic-article .edu-table.kiwi-edu-table-with-mnemonic tbody > tr > th[colspan="3"] {
  background: #f1f5fa !important;
  color: #174a82;
  font-weight: 700;
  text-align: center;
}
.mf-article .edu-table.kiwi-edu-table-visual-compare tbody > tr.kiwi-edu-table-visual-titles > th,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare tbody > tr.kiwi-edu-table-visual-titles > th {
  background: #f3f8fe !important;
  color: #172846;
  font-weight: 700 !important;
  text-align: left !important;
  vertical-align: top;
}
.mf-article .edu-table.kiwi-edu-table-visual-compare tbody > tr.kiwi-edu-table-visual-graphs > td,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare tbody > tr.kiwi-edu-table-visual-graphs > td {
  text-align: center;
  vertical-align: top;
}
.mf-article .edu-table.kiwi-edu-table-visual-compare tbody > tr.kiwi-edu-table-visual-graphs img,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare tbody > tr.kiwi-edu-table-visual-graphs img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}
.mf-article .edu-table.kiwi-edu-table-visual-compare .kiwi-edu-table-visual-flat-cell,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare .kiwi-edu-table-visual-flat-cell {
  font-weight: 400;
  text-align: center;
  color: #526780;
}
.mf-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.mf-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain th,
.mf-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain td,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain th,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain td {
  border: 1px solid #dce6f1;
  padding: 8px 10px;
  vertical-align: top;
  text-align: left !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.mf-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain th,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain th {
  width: 38%;
  background: #f3f8fe;
  font-weight: 700 !important;
}
/* Step-pattern explain grids (y interval → Δy₁…) under visual compare graphs */
.mf-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain-steps,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain-steps {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.mf-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain-steps td,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain-steps td {
  border: 1px solid #dce6f1;
  padding: 8px 10px;
  vertical-align: middle;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.mf-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain-steps td:first-child,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain-steps td:first-child {
  width: 52%;
  font-weight: 700 !important;
  background: #f3f8fe !important;
  text-align: left !important;
}
.mf-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain-steps td:last-child,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain-steps td:last-child {
  text-align: center !important;
}
.mf-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain-steps tbody tr:nth-child(even) td,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain-steps tbody tr:nth-child(even) td {
  background: #eef5fc !important;
}
.mf-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain-steps tbody tr:nth-child(even) td:first-child,
.kiwi-topic-article .edu-table.kiwi-edu-table-visual-compare table.kiwi-edu-table-explain-steps tbody tr:nth-child(even) td:first-child {
  background: #e5f0fa !important;
}
body.car-page .equation {
  font-size: clamp(1.05rem, 4.5vw, 1.45rem);
  padding: 12px 10px;
}
body.car-page .car-table-wrap {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
body.car-page .car-table {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}
body.car-page .car-table th,
body.car-page .car-table td {
  word-break: break-word;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  body.edu-page .edu-two {
    gap: 14px;
  }
  body.edu-page .edu-panel {
    padding: 16px 14px;
  }
  body.edu-page .edu-panel h3 {
    font-size: 17px;
  }
  body.edu-page .edu-formula {
    font-size: clamp(18px, 6vw, 22px);
    padding: 12px 10px;
  }
  body.edu-page .edu-table th,
  body.edu-page .edu-table td {
    padding: 8px 6px !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
  }
  body.car-page .car-table th,
  body.car-page .car-table td {
    padding: 8px 6px;
    font-size: 12px;
    line-height: 1.45;
  }
}

/* Hide TeX annotations when native MathML is shown (until KaTeX replaces <math>) */
math annotation[encoding="application/x-tex"] {
  display: none !important;
}

/* ==========================================================================
   DISPLAY MATH BLOCKS — horizontal center (DESIGN_STANDARDS.md)
   Overrides example step left-align when wrapped in .kiwi-math-block.
   ========================================================================== */
.mf-article .kiwi-math-block,
.kiwi-topic-article .kiwi-math-block {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0.85rem auto !important;
  padding: 0.1rem 0 !important;
  text-align: center !important;
  overflow: visible;
  box-sizing: border-box;
}
.mf-article .kiwi-math-block > math,
.mf-article .kiwi-math-block > p,
.mf-article .kiwi-math-block > .kiwi-katex-display,
.kiwi-topic-article .kiwi-math-block > math,
.kiwi-topic-article .kiwi-math-block > p,
.kiwi-topic-article .kiwi-math-block > .kiwi-katex-display {
  display: block !important;
  margin: 0 auto !important;
  text-align: center !important;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}
.mf-article .kiwi-example-standard > .kiwi-math-block,
.kiwi-topic-article .kiwi-example-standard > .kiwi-math-block {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.mf-article .kiwi-math-latex .katex-display,
.kiwi-topic-article .kiwi-math-latex .katex-display {
  margin: 0 auto;
  text-align: center;
}
.mf-article .kiwi-katex-display,
.kiwi-topic-article .kiwi-katex-display,
.mf-article .kiwi-math-block .katex-display,
.kiwi-topic-article .kiwi-math-block .katex-display {
  margin: 0.85rem auto;
  text-align: center;
  max-width: 100%;
  overflow: visible;
}
@media (max-width: 520px) {
  .mf-article .kiwi-math-block,
  .kiwi-topic-article .kiwi-math-block {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }
}
/* Rule + “where …” gloss: centered formula, left-aligned prose on the next line */
.mf-article .kiwi-math-where,
.kiwi-topic-article .kiwi-math-where {
  margin: 0.35rem 0 1rem;
  text-align: left;
}
.mf-article .kiwi-math-where > .kiwi-math-block,
.kiwi-topic-article .kiwi-math-where > .kiwi-math-block {
  margin-top: 0.35rem !important;
  margin-bottom: 0.4rem !important;
}
.mf-article .kiwi-math-where > p,
.kiwi-topic-article .kiwi-math-where > p {
  margin: 0;
  text-align: left;
}
.mf-article ul.kiwi-example-list + .kiwi-math-where,
.kiwi-topic-article ul.kiwi-example-list + .kiwi-math-where {
  margin-inline-start: 3ch;
}
.mf-article .kiwi-katex-inline,
.kiwi-topic-article .kiwi-katex-inline,
.mf-article .kiwi-single-example .kiwi-katex-inline,
.mf-article .kiwi-single-example math[display="inline"],
.kiwi-topic-article .kiwi-single-example .kiwi-katex-inline,
.kiwi-topic-article .kiwi-single-example math[display="inline"] {
  display: inline;
  white-space: nowrap;
  vertical-align: middle;
}
.mf-article .kiwi-single-example .kiwi-katex-inline .katex,
.mf-article .kiwi-single-example math[display="inline"] + span {
  vertical-align: middle;
}
.mf-article .kiwi-single-example > :is(.kiwi-katex-inline, math) {
  margin-right: 0.35em;
}

/* ==========================================================================
   WORKED EXAMPLES — canonical layout (DESIGN_STANDARDS.md)
   ========================================================================== */
.mf-article ul.kiwi-example-list {
  list-style: disc outside;
  padding-left: 2.5rem;
  margin: 0.5rem 0 1rem;
  text-align: left;
}
.mf-article blockquote.kiwi-example-answer > ul.kiwi-example-list,
.kiwi-topic-article blockquote.kiwi-example-answer > ul.kiwi-example-list {
  margin: 0.35rem 0 0.6rem 3ch;
}
.mf-article blockquote.kiwi-example-answer,
.kiwi-topic-article blockquote.kiwi-example-answer {
  display: block;
  margin: 0.35rem 0 1rem;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 3px solid #cde3fa;
  background: transparent;
  text-align: left;
  font-weight: 400;
}
.mf-article blockquote.kiwi-example-answer p,
.kiwi-topic-article blockquote.kiwi-example-answer p {
  margin: 0 0 0.5rem;
  font-weight: 400;
}
.mf-article blockquote.kiwi-example-answer p:last-child,
.kiwi-topic-article blockquote.kiwi-example-answer p:last-child {
  margin-bottom: 0;
}
/* Inline list worked examples: math only, no accent bar */
.mf-article ul.kiwi-example-list > li blockquote.kiwi-example-answer,
.kiwi-topic-article ul.kiwi-example-list > li blockquote.kiwi-example-answer {
  border-left: 0;
  padding-left: 0;
}
.mf-article ul.kiwi-example-list > li > ol.kiwi-example-steps,
.kiwi-topic-article ul.kiwi-example-list > li > ol.kiwi-example-steps {
  margin: 0.35rem 0 0.6rem 3ch !important;
  padding: 0 !important;
  list-style-type: decimal !important;
  list-style-position: inside !important;
  text-align: left !important;
}
.mf-article ul.kiwi-example-list > li > ol.kiwi-example-steps > li,
.kiwi-topic-article ul.kiwi-example-list > li > ol.kiwi-example-steps > li {
  display: list-item !important;
  margin: 0.35rem 0 !important;
  padding: 0 !important;
  font-weight: 400 !important;
  color: #111 !important;
}
.mf-article ul.kiwi-example-list > li > ol.kiwi-example-steps > li > p,
.kiwi-topic-article ul.kiwi-example-list > li > ol.kiwi-example-steps > li > p {
  display: block;
  margin: 0.35rem 0 0;
  text-align: center;
}
.mf-article ul.kiwi-example-list > li > ol.kiwi-example-steps > li > .kiwi-math-block,
.kiwi-topic-article ul.kiwi-example-list > li > ol.kiwi-example-steps > li > .kiwi-math-block {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0.35rem 0 0.5rem !important;
  justify-content: flex-start !important;
  text-align: left !important;
}
.mf-article
  ul.kiwi-example-list
  > li
  > ol.kiwi-example-steps
  > li
  > .kiwi-math-block
  > :is(math, .kiwi-katex-display),
.kiwi-topic-article
  ul.kiwi-example-list
  > li
  > ol.kiwi-example-steps
  > li
  > .kiwi-math-block
  > :is(math, .kiwi-katex-display) {
  margin: 0.25rem 0 0 !important;
  text-align: left !important;
}
.kiwi-back-to-top.kiwi-back-to-top--article {
  top: auto;
  bottom: 25vh;
  transform: none;
}
.mf-article ul.kiwi-sequence-type-list,
.kiwi-topic-article ul.kiwi-sequence-type-list {
  list-style: disc outside;
  padding-left: 2.5rem;
  margin: 0.5rem 0 0.25rem;
  text-align: left;
}
.mf-article ul.kiwi-sequence-type-list > li,
.kiwi-topic-article ul.kiwi-sequence-type-list > li {
  margin: 0;
  padding-left: 0.35rem;
}
.mf-article ul.kiwi-sequence-type-list > li > span,
.kiwi-topic-article ul.kiwi-sequence-type-list > li > span {
  display: block;
}
.mf-article .kiwi-sequence-detail,
.kiwi-topic-article .kiwi-sequence-detail {
  margin: 0.35rem 0 0.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.mf-article ul.kiwi-sequence-type-list > li > .kiwi-sequence-detail > p,
.kiwi-topic-article ul.kiwi-sequence-type-list > li > .kiwi-sequence-detail > p {
  margin: 0 0 0.5rem;
}
.mf-article ul.kiwi-sequence-type-list .kiwi-sequence-detail > ul.kiwi-example-list,
.kiwi-topic-article ul.kiwi-sequence-type-list .kiwi-sequence-detail > ul.kiwi-example-list {
  margin: 0.35rem 0 0.6rem 3ch;
  padding-left: 1.5rem;
}
.mf-article ul.kiwi-sequence-type-list > li + li,
.kiwi-topic-article ul.kiwi-sequence-type-list > li + li {
  margin-top: 0.5lh;
}
.mf-article ul.kiwi-example-list > li,
.kiwi-topic-article ul.kiwi-example-list > li {
  margin: 0;
  padding-left: 0.35rem;
}
/* Prose / example bullet lists: half a text line between items */
.mf-article ul:not(.kiwi-example-variants) > li + li,
.kiwi-topic-article ul:not(.kiwi-example-variants) > li + li,
aside.kiwi-word-info-panel ul > li + li,
aside.kiwi-insight-panel ul > li + li,
aside.kiwi-curriculum-panel ul > li + li {
  margin-top: 0.5lh;
}
.mf-article ul.kiwi-example-list > li .kiwi-example-list-part,
.kiwi-topic-article ul.kiwi-example-list > li .kiwi-example-list-part {
  display: block;
  margin-top: 0.42em;
}
.mf-article ul.kiwi-example-list > li .kiwi-example-list-part:first-child,
.kiwi-topic-article ul.kiwi-example-list > li .kiwi-example-list-part:first-child {
  margin-top: 0;
}
.mf-article ul.kiwi-example-list > li .kiwi-example-list-part.kiwi-example-list-step,
.kiwi-topic-article ul.kiwi-example-list > li .kiwi-example-list-part.kiwi-example-list-step {
  margin-left: 3ch;
}
.mf-article ul.kiwi-example-list > li .kiwi-example-list-part.kiwi-example-list-answer,
.kiwi-topic-article ul.kiwi-example-list > li .kiwi-example-list-part.kiwi-example-list-answer {
  margin-left: 0;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 3px solid #cde3fa;
  font-weight: 400;
}
.mf-article .kiwi-example-standard > .kiwi-example-list-part:not(.kiwi-example-list-step):not(.kiwi-example-list-step-nested):not(.kiwi-example-list-answer),
.kiwi-topic-article .kiwi-example-standard > .kiwi-example-list-part:not(.kiwi-example-list-step):not(.kiwi-example-list-step-nested):not(.kiwi-example-list-answer) {
  margin: 0.35rem 0 0.4rem 3ch;
  padding: 0;
  text-align: left;
  font-weight: 400;
}
.mf-article .kiwi-example-standard > .kiwi-example-list-part.kiwi-example-list-step,
.kiwi-topic-article .kiwi-example-standard > .kiwi-example-list-part.kiwi-example-list-step {
  margin: 0.35rem 0 0.45rem 6ch;
  padding: 0;
  text-align: left;
  font-weight: 400;
}
.mf-article .kiwi-example-standard > .kiwi-example-list-part.kiwi-example-list-step-nested,
.kiwi-topic-article .kiwi-example-standard > .kiwi-example-list-part.kiwi-example-list-step-nested {
  margin: 0.35rem 0 0.45rem 9ch;
  padding: 0;
  text-align: left;
  font-weight: 400;
  color: #111;
}
.mf-article .kiwi-example-standard > .kiwi-example-list-part.kiwi-example-list-answer,
.kiwi-topic-article .kiwi-example-standard > .kiwi-example-list-part.kiwi-example-list-answer {
  margin: 0.5rem 0 0.6rem 3ch;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 3px solid #cde3fa;
  font-weight: 400;
  text-align: left;
}
.mf-article .kiwi-example-standard,
.kiwi-topic-article .kiwi-example-standard {
  margin: 0.35rem 0 1rem;
  padding: 0;
}
.mf-article .kiwi-example-standard > .kiwi-single-example,
.mf-article .kiwi-example-standard > .kiwi-example-question,
.kiwi-topic-article .kiwi-example-standard > .kiwi-single-example,
.kiwi-topic-article .kiwi-example-standard > .kiwi-example-question,
.mf-article .kiwi-example-standard > .kiwi-example-question-math,
.kiwi-topic-article .kiwi-example-standard > .kiwi-example-question-math {
  margin: 0.35rem 0 0.4rem 3ch;
  padding: 0;
  text-align: left;
  background: transparent;
  border: 0;
  font-weight: 400;
}
.mf-article .kiwi-example-standard > ol.kiwi-example-steps,
.kiwi-topic-article .kiwi-example-standard > ol.kiwi-example-steps {
  margin: 0.35rem 0 0.6rem 6ch !important;
  padding: 0 !important;
  list-style-type: decimal !important;
  list-style-position: inside !important;
  text-align: left !important;
}
.mf-article .kiwi-example-standard > ol.kiwi-example-steps > li,
.kiwi-topic-article .kiwi-example-standard > ol.kiwi-example-steps > li {
  display: list-item !important;
  list-style-type: decimal !important;
  list-style-position: inside !important;
  margin: 0.3rem 0 !important;
  padding: 0 !important;
  font-weight: 400 !important;
  color: #111 !important;
  text-align: left !important;
}
.mf-article .kiwi-example-standard > ol.kiwi-example-steps > li::marker,
.kiwi-topic-article .kiwi-example-standard > ol.kiwi-example-steps > li::marker {
  font-weight: 400 !important;
  color: #111 !important;
}
.mf-article .kiwi-example-standard > .kiwi-single-example + ul.kiwi-example-list,
.mf-article .kiwi-example-standard > .kiwi-example-question + ul.kiwi-example-list,
.kiwi-topic-article .kiwi-example-standard > .kiwi-single-example + ul.kiwi-example-list,
.kiwi-topic-article .kiwi-example-standard > .kiwi-example-question + ul.kiwi-example-list {
  margin: 0.35rem 0 0.6rem 6ch !important;
  padding: 0 !important;
  list-style-type: disc !important;
  list-style-position: inside !important;
  text-align: left !important;
}
.mf-article .kiwi-example-standard > .kiwi-single-example + ul.kiwi-example-list > li,
.mf-article .kiwi-example-standard > .kiwi-example-question + ul.kiwi-example-list > li,
.kiwi-topic-article .kiwi-example-standard > .kiwi-single-example + ul.kiwi-example-list > li,
.kiwi-topic-article .kiwi-example-standard > .kiwi-example-question + ul.kiwi-example-list > li {
  display: list-item !important;
  list-style-type: disc !important;
  list-style-position: inside !important;
  margin: 0.3rem 0 !important;
  padding: 0 !important;
  font-weight: 400 !important;
  color: #111 !important;
  text-align: left !important;
}
.mf-article .kiwi-example-standard > .kiwi-single-example + ul.kiwi-example-list > li::marker,
.mf-article .kiwi-example-standard > .kiwi-example-question + ul.kiwi-example-list > li::marker,
.kiwi-topic-article .kiwi-example-standard > .kiwi-single-example + ul.kiwi-example-list > li::marker,
.kiwi-topic-article .kiwi-example-standard > .kiwi-example-question + ul.kiwi-example-list > li::marker {
  font-weight: 400 !important;
  color: #111 !important;
}
.mf-article .kiwi-example-standard > ul.kiwi-example-variants,
.kiwi-topic-article .kiwi-example-standard > ul.kiwi-example-variants {
  margin: 0.35rem 0 0.6rem 6ch !important;
  padding: 0 !important;
  list-style-type: disc !important;
  list-style-position: inside !important;
  text-align: left !important;
}
.mf-article .kiwi-example-standard > ul.kiwi-example-variants > li,
.kiwi-topic-article .kiwi-example-standard > ul.kiwi-example-variants > li {
  display: list-item !important;
  list-style-type: disc !important;
  list-style-position: inside !important;
  margin: 0.3rem 0 !important;
  padding: 0 !important;
  font-weight: 400 !important;
  color: #111 !important;
  text-align: left !important;
}
.mf-article .kiwi-example-standard > ul.kiwi-example-variants > li::marker,
.kiwi-topic-article .kiwi-example-standard > ul.kiwi-example-variants > li::marker {
  font-weight: 400 !important;
  color: #111 !important;
}
.mf-article .kiwi-example-standard > .kiwi-example-explanation,
.kiwi-topic-article .kiwi-example-standard > .kiwi-example-explanation {
  margin: 0.45rem 0 0.45rem 6ch;
  text-align: left;
  font-weight: 400;
}
.mf-article .kiwi-example-standard > blockquote.kiwi-example-answer,
.mf-article .kiwi-example-standard > p.kiwi-example-answer,
.kiwi-topic-article .kiwi-example-standard > blockquote.kiwi-example-answer,
.kiwi-topic-article .kiwi-example-standard > p.kiwi-example-answer,
.kiwi-topic-article .kiwi-example-standard > .kiwi-example-answer {
  display: block;
  margin: 0.6rem 0 0.6rem 3ch !important;
  padding: 0.15rem 0 0.15rem 1rem !important;
  border-left: 3px solid #cde3fa !important;
  background: transparent !important;
  text-align: left !important;
  font-weight: 400 !important;
}
.mf-article .kiwi-example-standard > blockquote.kiwi-example-answer p,
.mf-article .kiwi-example-standard > blockquote.kiwi-example-answer strong,
.kiwi-topic-article .kiwi-example-standard > blockquote.kiwi-example-answer p,
.kiwi-topic-article .kiwi-example-standard > blockquote.kiwi-example-answer strong {
  margin: 0 !important;
  font-weight: 400 !important;
}

/* ==========================================================================
   LEARNING / WORD INFO PANELS (tip panels)
   Row 1: lightbulb (col 1) + title OR first line of body text (col 2).
   Later rows: body only in col 2, left-aligned with row 1 text (not the bulb).
   Chrome: cream fill, gold frame, 3px gold left accent (#e4b54e).
   ========================================================================== */
aside.kiwi-word-info-panel,
aside.kiwi-insight-panel,
aside.kiwi-curriculum-panel {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 1.15rem 0;
  padding: 1rem 1.2rem;
  background: #fff8e9;
  border: 1px solid #f0d58d;
  border-left: 3px solid #e4b54e;
  border-radius: 12px;
  color: #503d24;
  font-weight: 400;
  line-height: 1.65;
  overflow-wrap: anywhere;
  text-align: left;
}
aside.kiwi-word-info-panel p,
aside.kiwi-insight-panel p,
aside.kiwi-curriculum-panel p,
aside.kiwi-word-info-panel li,
aside.kiwi-insight-panel li,
aside.kiwi-curriculum-panel li {
  margin: 0 0 10px;
  color: inherit;
  text-align: left;
  font-weight: 400;
}
aside.kiwi-word-info-panel p:last-child,
aside.kiwi-insight-panel p:last-child,
aside.kiwi-curriculum-panel p:last-child,
aside.kiwi-word-info-panel li:last-child,
aside.kiwi-insight-panel li:last-child,
aside.kiwi-curriculum-panel li:last-child {
  margin-bottom: 0;
}
aside.kiwi-word-info-panel strong,
aside.kiwi-insight-panel strong,
aside.kiwi-curriculum-panel strong {
  font-weight: 700;
}
aside.kiwi-word-info-panel a,
aside.kiwi-curriculum-panel a {
  text-decoration: underline;
}
aside.kiwi-word-info-panel ul,
aside.kiwi-word-info-panel ol,
aside.kiwi-insight-panel ul,
aside.kiwi-insight-panel ol {
  padding-left: 1.5rem;
  margin-left: 0;
}
aside.kiwi-word-info-panel .kiwi-math-block,
aside.kiwi-insight-panel .kiwi-math-block,
aside.kiwi-curriculum-panel .kiwi-math-block {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
aside.kiwi-word-info-panel math[display="block"],
aside.kiwi-insight-panel math[display="block"],
aside.kiwi-curriculum-panel math[display="block"] {
  display: block;
  margin-inline: auto;
}
aside.kiwi-curriculum-panel .kiwi-course-code-explainer {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.55;
  color: #2a4a68;
}

aside.kiwi-curriculum-panel .kiwi-curriculum-heading {
  display: block;
  margin-bottom: 0.5rem;
  color: #895b0e;
  font-weight: 700;
  text-align: left;
}
@media (max-width: 600px) {
  aside.kiwi-word-info-panel,
  aside.kiwi-insight-panel,
  aside.kiwi-curriculum-panel {
    padding: 0.85rem 1rem;
  }
}
aside.kiwi-word-info-panel,
aside.kiwi-insight-panel {
  --kiwi-panel-header-gap: 9px;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--kiwi-panel-header-gap);
  row-gap: 9px;
  align-items: start;
}
aside.kiwi-word-info-panel .kiwi-panel-heading,
aside.kiwi-word-info-panel .kiwi-word-info-header,
aside.kiwi-insight-panel .kiwi-insight-header {
  display: contents !important;
}
aside.kiwi-word-info-panel :is(.kiwi-panel-icon, .kiwi-word-info-icon),
aside.kiwi-insight-panel .kiwi-insight-icon {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  align-self: start;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.25;
  font-size: 1.05rem;
}
aside.kiwi-word-info-panel .kiwi-panel-heading > :not(.kiwi-panel-icon),
aside.kiwi-word-info-panel .kiwi-word-info-title,
aside.kiwi-insight-panel .kiwi-insight-title,
aside.kiwi-insight-panel .kiwi-insight-header > :not(.kiwi-insight-icon):not(.kiwi-word-info-icon) {
  grid-column: 2;
  grid-row: 1;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.25;
  color: #b85f0c !important;
  font-weight: 700;
  text-align: left;
}
aside.kiwi-word-info-panel > :not(.kiwi-panel-heading):not(.kiwi-word-info-header),
aside.kiwi-insight-panel > :not(.kiwi-insight-header):not(.kiwi-word-info-header) {
  grid-column: 2;
  margin-inline-start: 0 !important;
  min-width: 0;
}
aside.kiwi-word-info-panel > .kiwi-word-info-body,
aside.kiwi-insight-panel > .kiwi-insight-body,
aside.kiwi-word-info-panel > .kiwi-panel-content,
aside.kiwi-insight-panel > .kiwi-panel-content {
  grid-column: 2;
  margin-inline-start: 0 !important;
  min-width: 0;
}
aside.kiwi-word-info-panel:where(
    :has(.kiwi-word-info-header > :only-child:is(.kiwi-word-info-icon, .kiwi-panel-icon)),
    :has(.kiwi-panel-heading > :only-child.kiwi-panel-icon),
    :has(.kiwi-insight-header > :only-child.kiwi-insight-icon)
  )
  > .kiwi-panel-content {
  display: contents !important;
}
aside.kiwi-word-info-panel:where(
    :has(.kiwi-word-info-header > :only-child:is(.kiwi-word-info-icon, .kiwi-panel-icon)),
    :has(.kiwi-panel-heading > :only-child.kiwi-panel-icon),
    :has(.kiwi-insight-header > :only-child.kiwi-insight-icon)
  )
  .kiwi-panel-content > * {
  grid-column: 2;
  min-width: 0;
}
/* Icon-only header: first body line shares row 1 with the bulb */
aside.kiwi-word-info-panel:where(
    :has(.kiwi-word-info-header > :only-child:is(.kiwi-word-info-icon, .kiwi-panel-icon)),
    :has(.kiwi-panel-heading > :only-child.kiwi-panel-icon),
    :has(.kiwi-insight-header > :only-child.kiwi-insight-icon)
  )
  > :is(.kiwi-word-info-body, .kiwi-insight-body) {
  display: contents !important;
}
aside.kiwi-word-info-panel:where(
    :has(.kiwi-word-info-header > :only-child:is(.kiwi-word-info-icon, .kiwi-panel-icon)),
    :has(.kiwi-panel-heading > :only-child.kiwi-panel-icon),
    :has(.kiwi-insight-header > :only-child.kiwi-insight-icon)
  )
  :is(.kiwi-word-info-body, .kiwi-insight-body) > * {
  grid-column: 2;
  min-width: 0;
}
aside.kiwi-word-info-panel:where(
    :has(.kiwi-word-info-header > :only-child:is(.kiwi-word-info-icon, .kiwi-panel-icon)),
    :has(.kiwi-panel-heading > :only-child.kiwi-panel-icon),
    :has(.kiwi-insight-header > :only-child.kiwi-insight-icon)
  )
  .kiwi-word-info-body > :first-child,
aside.kiwi-word-info-panel:where(
    :has(.kiwi-panel-heading > :only-child.kiwi-panel-icon)
  )
  > :is(p, ul, ol, blockquote, div):not(.kiwi-panel-heading):not(.kiwi-word-info-header):first-of-type {
  margin-top: 0;
}
aside.kiwi-insight-panel .kiwi-insight-body > :first-child {
  margin-top: 0;
}

/* Basic ↔ advanced sibling-lesson cross-links (navigation, not in-lesson tips) */
aside.kiwi-word-info-panel.kiwi-skill-crosslink-panel {
  background: #fff;
  border: 1px solid #9ec5e8;
  border-left: 4px solid #1768b2;
  color: #1a3352;
}
aside.kiwi-word-info-panel.kiwi-skill-crosslink-panel a {
  color: #0b5cad;
  font-weight: 700;
}
aside.kiwi-word-info-panel.kiwi-skill-crosslink-panel .kiwi-panel-icon {
  color: #1768b2;
  font-size: 1.08rem;
}

/* —— Global Pagefind search (header + hub fields) —— */
.kiwi-search-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #dce6f1;
  border-radius: 11px;
  background: #f7faff;
  color: #174879;
  cursor: pointer;
  flex-shrink: 0;
}
.kiwi-search-open:hover {
  background: #e8f2ff;
  color: #0756ba;
}
body.kiwi-search-open {
  overflow: hidden;
  padding-top: var(--kiwi-header-height, 73px);
}
body.kiwi-search-open.home-page {
  padding-top: 0;
}
body.kiwi-search-open > :not(.site-header):not(#kiwi-search-root) {
  visibility: hidden;
  pointer-events: none;
}
body.kiwi-search-open .site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10002;
  background: #fff;
  box-shadow: 0 1px 0 #e6eaf2;
  visibility: visible;
  pointer-events: auto;
}
.kiwi-search-root {
  position: fixed;
  inset: 0;
  z-index: 10001;
  pointer-events: none;
}
.kiwi-search-root:not([hidden]) {
  pointer-events: auto;
}
.kiwi-search-root[hidden] {
  display: none !important;
}
.kiwi-search-scrim {
  position: absolute;
  inset: 0;
  background: rgba(16, 23, 71, 0.45);
}
.kiwi-search-panel {
  position: absolute;
  top: calc(var(--kiwi-header-height, 73px) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  width: min(640px, calc(100vw - 28px));
  max-height: calc(100vh - var(--kiwi-header-height, 73px) - 28px);
  overflow: auto;
  margin: 0;
  padding: 20px 22px 18px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #dce6f1;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(16, 23, 71, 0.18);
}
.kiwi-search-scope-row[hidden] {
  display: none !important;
}
.kiwi-search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.kiwi-search-title {
  margin: 0;
  font-size: 18px;
  color: #153d70;
}
.kiwi-search-close {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: #5e6f88;
  cursor: pointer;
  padding: 4px 8px;
}
.kiwi-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid #cbd5e7;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  color: #14264d;
}
.kiwi-search-input:focus {
  outline: none;
  border-color: #1768b2;
  box-shadow: 0 0 0 3px rgba(23, 104, 178, 0.12);
}
.kiwi-search-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #62738a;
}
.kiwi-search-offline {
  margin: 10px 0 0;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #66542a;
  background: #fff8e7;
  border: 1px solid #f0dfaa;
  border-radius: 10px;
}
.site-nav .kiwi-search-open {
  margin-right: 4px;
}
.kiwi-search-scope-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #edf5ff;
  border-radius: 10px;
  font-size: 13px;
  color: #173e70;
}
.kiwi-search-scope-clear {
  border: 0;
  background: transparent;
  color: #1768b2;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}
.kiwi-search-results {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  max-height: min(52vh, 420px);
  overflow-y: auto;
}
.kiwi-search-hit a {
  display: block;
  padding: 12px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}
.kiwi-search-hit a:hover {
  background: #f4f8fe;
}
.kiwi-search-hit-title {
  display: block;
  font-weight: 700;
  color: #173e70;
  font-size: 15px;
  line-height: 1.35;
}
.kiwi-search-hit-crumb {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #62738a;
}
.kiwi-search-hit-excerpt {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: #526780;
  line-height: 1.45;
}
.kiwi-search-hit mark,
.kiwi-search-hit-excerpt mark,
.kiwi-search-hit-title mark {
  background: #fff3b8;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
  font-weight: inherit;
}
.kiwi-search-empty {
  padding: 16px 10px;
  color: #62738a;
  font-size: 14px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.edu-grade-browse-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 8px;
}

.edu-grade-browse-wrap .edu-button--secondary {
  background: #fff;
  color: #155d9d !important;
  border: 1px solid #cddff2;
  box-shadow: none;
}

.edu-grade-browse-wrap .edu-button--secondary:hover,
.edu-grade-browse-wrap .edu-button--secondary:focus-visible {
  background: #eaf3fd;
  border-color: #b8d4f0;
}

.kiwi-grade-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(520px, 100%);
  margin: 0;
}

.kiwi-grade-picker-section {
  margin-top: 28px;
}

.kiwi-grade-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #dce6f1;
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.kiwi-grade-pick:hover {
  border-color: #b8d4f0;
  box-shadow: 0 6px 18px rgba(24, 55, 95, 0.07);
  transform: translateY(-1px);
}

.kiwi-grade-pick:focus-visible {
  outline: 2px solid #1768b2;
  outline-offset: 2px;
}

.kiwi-grade-pick-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.kiwi-grade-pick-label {
  font-size: 17px;
  font-weight: 600;
  color: #173e70;
  line-height: 1.3;
}

.kiwi-grade-pick-meta {
  font-size: 12px;
  font-weight: 500;
  color: #62738a;
  line-height: 1.4;
}

.kiwi-grade-pick-cta {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: #1768b2;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .kiwi-grade-pick {
    flex-wrap: wrap;
    padding: 14px 16px;
  }
  .kiwi-grade-pick-cta {
    width: 100%;
    padding-top: 2px;
  }
}

.kiwi-inclass-site-grade {
  margin-top: 22px;
  padding: 20px 22px;
  max-width: 560px;
  border: 1px solid #dce7f5;
  border-radius: 16px;
  background: linear-gradient(125deg, #f6faff 0%, #faf9ff 55%, #fffaf3 100%);
}

.kiwi-inclass-site-grade h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: #153d70;
}

.kiwi-inclass-site-grade > p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.6;
  color: #5e6f88;
}

.kiwi-inclass-site-grade .kiwi-grade-picker {
  max-width: none;
}

.kiwi-book-toc {
  max-width: 720px;
  margin: 0;
  padding: 0;
}

/* Grade hub (math/grade-N.html): two-column chapter cards on desktop */
.kiwi-grade-hub .kiwi-grade-hub-main {
  max-width: 1080px;
}

.kiwi-grade-hub .kiwi-book-toc-section {
  margin-top: 32px;
  margin-bottom: 48px;
}

.kiwi-grade-hub .kiwi-book-toc,
.kiwi-ontario-course-main .kiwi-book-toc {
  max-width: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.kiwi-ontario-course-main .kiwi-book-toc {
  margin: 18px 0 6px;
}

@media (min-width: 768px) {
  .kiwi-grade-hub .kiwi-book-toc,
  .kiwi-ontario-course-main .kiwi-book-toc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
  }
}

.kiwi-grade-hub .kiwi-book-chapter,
.kiwi-ontario-course-main .kiwi-book-chapter {
  margin: 0;
  padding: 18px 20px 16px;
  border: 1px solid #dce6f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 55, 95, 0.05);
}

.kiwi-grade-hub .kiwi-book-chapter-head,
.kiwi-ontario-course-main .kiwi-book-chapter-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8eef5;
}

.kiwi-grade-hub .kiwi-book-chapter-number,
.kiwi-ontario-course-main .kiwi-book-chapter-number {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eaf4ff;
  color: #1768b2;
  font-weight: 900;
  font-size: 17px;
  line-height: 1;
}

.kiwi-grade-hub .kiwi-book-chapter-title,
.kiwi-ontario-course-main .kiwi-book-chapter-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  align-self: center;
}

.kiwi-grade-hub .kiwi-book-topic-list,
.kiwi-ontario-course-main .kiwi-book-topic-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.kiwi-grade-hub .kiwi-book-topic-row,
.kiwi-ontario-course-main .kiwi-book-topic-row {
  padding: 9px 0;
  margin: 0;
  border-bottom: 1px solid #f1f5fa;
  gap: 8px 12px;
}

.kiwi-grade-hub .kiwi-book-topic-row:last-child,
.kiwi-ontario-course-main .kiwi-book-topic-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.kiwi-grade-hub .kiwi-book-topic-list a,
.kiwi-ontario-course-main .kiwi-book-topic-list a {
  color: #1768b2;
  text-decoration: none;
  line-height: 1.5;
}

.kiwi-grade-hub .kiwi-book-topic-list a:hover,
.kiwi-ontario-course-main .kiwi-book-topic-list a:hover {
  text-decoration: underline;
  color: #10548f;
}

.kiwi-book-chapter {
  margin: 0 0 28px;
}

.kiwi-book-chapter-title {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.55;
  color: #14264d;
  font-weight: 400;
}

.kiwi-book-chapter-title strong {
  font-weight: 700;
}

.kiwi-book-topic-list {
  margin: 0;
  padding: 0 0 0 1.35rem;
  list-style: decimal;
}

.kiwi-book-topic-list li,
.kiwi-book-topic-list .kiwi-book-topic-row {
  margin: 0 0 8px;
  padding-left: 0.25rem;
  line-height: 1.45;
}

.kiwi-book-topic-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
}

.kiwi-book-topic-courses {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.kiwi-book-topic-courses .kiwi-grade-pill--course {
  font-size: 11px;
  vertical-align: baseline;
}

.kiwi-book-topic-list a {
  color: #14264d;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 16px;
}

.kiwi-book-topic-list a:hover {
  text-decoration: underline;
}

.kiwi-book-toc-section {
  margin-top: 24px;
}

/* Lesson sidebars: regular weight; current page uses highlight bar only */
.mf-sidebar .mf-trig-toc-parent a,
.mf-sidebar .mf-trig-toc-parent a.mf-current,
.kiwi-topic-sidebar a,
.kiwi-topic-sidebar a.active,
.kiwi-topic-sidebar a[aria-current="page"],
.mf-sidebar .mf-side-links a.mf-current,
.mf-sidebar .mf-side-links a[aria-current="page"],
.nf-lesson-sidebar nav a,
.nf-lesson-sidebar nav a.active,
.nf-lesson-sidebar nav a[aria-current="page"],
.foundation-level4 .mf-side-links a.mf-current {
  font-weight: 400;
}

.kiwi-back-to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 1200;
  margin: 0;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: #155d9d;
  background: #fff;
  border: 1px solid #cddff2;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(24, 55, 95, 0.12);
  cursor: pointer;
}

.kiwi-back-to-top:hover,
.kiwi-back-to-top:focus-visible {
  background: #eaf3fd;
  outline-offset: 2px;
}

.kiwi-back-to-top[hidden] {
  display: none;
}
