/* Learn Thai script-aware typography. No changes to lesson/audio/progress data. */
body.mark-portal,body.mark-login-page,body.offline-page{
  --thai-academic-font:"Noto Sans Thai Looped","Noto Looped Thai","Sarabun","Thonburi",Tahoma,"Leelawadee UI",sans-serif;
  --thai-modern-font:"Noto Sans Thai","Leelawadee UI","Thonburi",Tahoma,sans-serif;
  --font-ui:var(--thai-academic-font);
  --font-ipa:"DejaVu Sans","Noto Sans","Arial Unicode MS",Arial,sans-serif;
  font-family:var(--font-ui)!important;
}
/* Explicit script tags override Latin-heading rules and inherited display fonts. */
body.mark-portal [lang="th"],body.mark-portal .thai-academic-font{
  font-family:var(--thai-academic-font)!important;
  letter-spacing:normal!important;
  text-transform:none;
  word-break:normal;
  line-height:1.75;
  overflow:visible;
}
body.mark-portal .thai-modern-font{
  font-family:var(--thai-modern-font)!important;
  letter-spacing:normal!important;
  line-height:1.75;
}
body.mark-portal h1[lang="th"],body.mark-portal h2[lang="th"],body.mark-portal h3[lang="th"],
body.mark-portal .thai-vocabulary-title>span[lang="th"],body.mark-portal .thai-letter-copy strong[lang="th"]{
  font-weight:700;
  padding-block:.1em;
}
body.mark-portal .hero-emblem-overlay .big-heart,
body.mark-portal .hero-emblem-overlay .rice-line,
body.mark-portal .private-brand>span:first-child,
body.mark-portal .floating-hearts,
body.mark-portal .lesson-icon,
body.mark-portal .promise-section blockquote[lang="th"]{
  font-family:var(--thai-academic-font)!important;
  letter-spacing:normal!important;
  line-height:1.75;
}
body.mark-portal .hero-emblem-overlay .big-heart{font-weight:700;padding:.08em .15em;}
body.mark-portal .lesson-hero h1[lang="th"]{font-size:clamp(1.9rem,4.5vw,3.6rem);line-height:1.55;}
body.mark-portal .english-phonetics,body.mark-portal [lang="en-fonipa"]{
  font-family:var(--font-ipa)!important;
  font-weight:400;
  letter-spacing:normal;
  line-height:1.7;
}
/* Tone marks and above/below vowels need more room than Latin capitals. */
body.mark-portal .thai-font-pair{min-width:0;gap:6px;}
body.mark-portal .thai-font-pair>span{
  min-width:44px;min-height:64px;height:auto;box-sizing:border-box;
  padding:.18em .18em;line-height:1.65;font-weight:600;
  overflow:visible;white-space:nowrap;
}
body.mark-portal .tone-mark-symbol{line-height:1.8;padding-block:.15em;}
body.mark-portal .alphabet-key-grid>article>span[lang="th"]{line-height:1.8;}
body.mark-portal .game-audio-button{min-width:44px;min-height:44px;}
@media(max-width:620px){
  body.mark-portal .thai-font-pair>span{font-size:1.95rem;min-width:42px;}
  body.mark-portal .thai-letter-chip>.audio-controls,body.mark-portal .thai-vowel-chip>.audio-controls{
    grid-column:1/-1;justify-self:start;
  }
}

/* Thai pronunciation guides are Latin-script readings, not English translations. */
body.mark-portal .thai-phonetics {
  font-family:var(--font-ipa)!important;
  font-size:1rem;
  font-weight:600;
  color:var(--text-secondary,var(--ink));
  letter-spacing:normal;
  text-transform:none;
  line-height:1.7;
  margin:.3rem 0;
  overflow-wrap:anywhere;
}
