/* FAN TIẾNG NHẬT — shared screen typography. Loaded last on every page.
   Keep print worksheets, musical symbols, chess and handwriting glyphs independent. */
:root{
 --fan-font:-apple-system,BlinkMacSystemFont,'Segoe UI','Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif;
 --fan-body:0.875rem; --fan-caption:0.75rem; --fan-meta:0.6875rem;
 --fan-cover:clamp(1.625rem,2.7vw,2.375rem);
 --fan-title:1.5rem; --fan-section:1.25rem; --fan-subtitle:1rem;
 --learning-font:var(--fan-font); --learning-body:var(--fan-body);
 --learning-title:var(--fan-title); --learning-section:var(--fan-section);
 --learning-subtitle:var(--fan-subtitle); --learning-pattern:var(--fan-subtitle);
 --learning-example:var(--fan-body); --learning-translation:var(--fan-body); --learning-question:var(--fan-body);
}
/* Explicit descendants also replace old local font shorthands. Do not touch
   SVG/canvas, code samples, or the game's deliberately calligraphic artwork. */
body,body :where(*):not(:where(svg,svg *,canvas,code,code *,pre,pre *, .piece,.piece *, .river-calligraphy,.river-calligraphy *, .cavalry-caption,.cavalry-caption *, [class*="check-calligraphy"],[class*="check-calligraphy"] *,[class*="check-brush"],[class*="check-brush"] *)){
 font-family:var(--fan-font)!important;
}
@media screen{
 body{font-size:var(--fan-body)!important;line-height:1.8!important;font-weight:400;letter-spacing:normal}
 :where(h1){font-size:var(--fan-cover)!important;line-height:1.4!important;font-weight:700!important;letter-spacing:-.025em!important;text-transform:uppercase}
 :where(h2){font-size:var(--fan-section)!important;line-height:1.5!important;font-weight:700!important;letter-spacing:0!important}
 :where(h3){font-size:var(--fan-subtitle)!important;line-height:1.6!important;font-weight:700!important;letter-spacing:0!important}
 :where(h4){font-size:var(--fan-body)!important;line-height:1.6!important;font-weight:700!important}
 :where(table,td,th,li,label,blockquote){font-size:var(--fan-body)!important;line-height:1.8!important}
 :where(main p,.layout p,.course-main p):not(:where(.eyebrow,.reviewed-eyebrow,.kicker,.sub,.note,.meta,.reading-time,.word-kana,.kana,.pronunciation)){
  font-size:var(--fan-body)!important;line-height:1.8!important;
 }
 :where(button,input,select,textarea){font-family:var(--fan-font)!important}
 :where(input,textarea,select){font-size:var(--fan-body)!important;line-height:1.6!important}
 /* Text controls only. Icon-only buttons and language flags retain their glyph sizes. */
 :where(.primary,.secondary,.btn,.small-nav button,.pager button,.pagination button,.question-nav button,.actions button,.tabs button,.reading-tabs button,.exam-bar button,#sections button){
  font-size:var(--fan-caption)!important;font-weight:650!important;line-height:1.5!important;letter-spacing:0!important;
 }
 :where(.eyebrow,.reviewed-eyebrow,.kicker){font-size:var(--fan-meta)!important;line-height:1.6!important;font-weight:700!important;letter-spacing:.08em!important}
 :where(.badge,.pill,.note,.meta,.sub,.reading-time,.lead-note,.sidebar-intro,.progress-meta,.reading-feedback,footer,.footer,.fan-copyright){font-size:var(--fan-caption)!important;line-height:1.7!important}
 /* Covers use one scale; the active lesson's title uses a smaller shared scale. */
 :where(.lesson-header h1,.lesson-head h2,.reviewed-intro>h2,.reading-head h2,.page-heading h2,#episode-title,#lesson-title,#track-title){font-size:var(--fan-title)!important;line-height:1.5!important;font-weight:700!important;letter-spacing:0!important}
 /* Compact lists and their labels. */
 :where(.lesson-link,.lesson-copy b,.episode-button b,#page-list button,.sidebar nav button,aside nav button,.n5-sidebar-title,.sidebar-title,.sidebar-head strong){font-size:var(--fan-caption)!important;line-height:1.6!important;font-weight:650!important;letter-spacing:0!important}
 :where(.lesson-number,.lesson-copy small,#page-list small,.page-index,.group-name){font-size:var(--fan-meta)!important;line-height:1.6!important;letter-spacing:0!important}
 /* Japanese examples and their Vietnamese meanings have equal reading size.
    Standalone kana/kanji teaching glyphs and vocabulary headwords stay larger. */
 :where(.jp,.reviewed-jp,.reviewed-vi,.sentence-jp,.sentence-vi,.transcript-jp,.transcript-vi,.vi-line,.word-meaning,.word-translation,.example-jp,.example-vi,.example .vi,.example .meaning,.translation,.vi,.meaning,.reading-passage,.reading-translation,.reading-options button,.reading-question .prompt,.prompt,.choice,.passage,.podcast-japanese,.podcast-meaning,.preview-row>div,.preview-row p,.video-note-jp,.video-note-kana,.video-note-vi,.video-note-grammar p,.video-note-words p,#episode-japanese){
  font-size:var(--fan-body)!important;line-height:1.9!important;letter-spacing:0!important;
 }
 :where(.word-kana,.pronunciation){font-size:var(--fan-caption)!important;line-height:1.7!important}
 :where(.pattern-name,.point h3){font-size:var(--fan-subtitle)!important;line-height:1.6!important}
 /* Deliberately small player labels have equal sizing. */
 .podcast-course .player-heading .eyebrow,.podcast-course .transcript-panel>[data-ui="transcript"]{font-size:var(--fan-meta)!important;letter-spacing:.08em!important}
 /* Consistent logo typography across desktop and mobile headers. */
 header .brand,header .brand b{font-size:1.125rem!important;font-weight:800!important;line-height:1.3!important;letter-spacing:-.02em!important}
 header .brand small{font-size:.625rem!important;font-weight:750!important;line-height:1.5!important;letter-spacing:.034em!important}
 @media(max-width:700px){
  :root{--fan-title:1.375rem}
  header .brand,header .brand b{font-size:.875rem!important}
  header .brand small{font-size:.5625rem!important;letter-spacing:.0125em!important}
 }
 @media(max-width:360px){header .brand small{font-size:.5rem!important}}
 /* Browser zoom on form focus should not disrupt the phone layout. */
 @media(hover:none) and (pointer:coarse){input,textarea,select{font-size:1rem!important}}
}
