:root{--blue:#008be0;--deep:#002b65;--mid:#086eae;--ink:#172e4c;--muted:#657a91;--bg:#f5f9ff;--line:#e1eaf4;--white:#fff;--green:#10a389;--gold:#f7b743}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,Arial,sans-serif;line-height:1.5}button,input,textarea,select{font:inherit}button{cursor:pointer}a{color:#087cbe}.frame{max-width:1280px;margin:auto;min-height:100vh}.header{display:flex;align-items:center;gap:14px;justify-content:space-between;background:white;padding:15px 32px;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:10;box-shadow:0 2px 16px #123f6508}.logo{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--deep);font-size:23px;font-weight:900}.logoicon{background:linear-gradient(135deg,#00a0e8,#00478f);color:white;border-radius:13px;padding:7px 11px;font-size:24px}.logo span span{color:var(--blue)}.navline{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.navline button{border:0;background:none;color:#667991;font-size:13px;padding:10px 13px;border-radius:10px;font-weight:700}.navline button.active,.navline button:hover{background:#e8f4ff;color:#056da6}.topbadge{font-size:11px;font-weight:800;white-space:nowrap;color:var(--mid);background:#e6f7ff;border-radius:999px;padding:8px 12px}.main{padding:28px 32px 70px}.hero{background:linear-gradient(118deg,#002d61,#0575b9 69%,#23abd0);color:white;border-radius:22px;min-height:245px;position:relative;overflow:hidden;padding:39px 43px;display:flex;align-items:center;justify-content:space-between;gap:22px}.eyebrow{font-size:11px;letter-spacing:.17em;color:#9ce2ff;font-weight:900}.hero h1{font-size:35px;line-height:1.18;margin:11px 0;letter-spacing:-1px}.hero p{max-width:670px;color:#d9f3ff;font-size:14px}.heroicon{font-size:102px;opacity:.88;filter:drop-shadow(0 12px 13px #001b3960);transform:rotate(-9deg)}.hero:before{content:'π  ∞  ∑  x²';position:absolute;font-size:100px;font-weight:900;opacity:.06;right:10px;bottom:-33px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:11px;padding:12px 18px;font-weight:800;font-size:13px;background:var(--blue);color:white;text-decoration:none}.btn:hover{filter:brightness(.96)}.btn.white{background:white;color:var(--deep)}.btn.outline{background:white;border:1px solid #b9daf0;color:var(--deep)}.btn.secondary{background:#eaf5ff;color:var(--deep)}.btn:disabled{opacity:.5;cursor:not-allowed}.sectiontitle{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:31px 0 16px}.sectiontitle h2{font-size:22px;margin:0}.sectiontitle small{color:var(--muted)}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.chaptercard,.panel,.lessoncard,.stat,.discover{background:white;border:1px solid var(--line);border-radius:17px;box-shadow:0 6px 24px #12345608}.chaptercard{padding:22px;cursor:pointer;transition:.18s}.chaptercard:hover{border-color:#66baf0;transform:translateY(-2px)}.chaptercard .n{display:inline-grid;place-items:center;background:#e7f6ff;color:#007ec1;border-radius:12px;height:43px;width:43px;font-weight:900}.chaptercard h3{font-size:15px;line-height:1.4;margin:14px 0 7px}.chaptercard p{margin:0;color:var(--muted);font-size:12px}.chaptercard .line{margin-top:16px;font-size:11px;color:var(--mid);font-weight:800}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:13px;margin:20px 0}.stat{padding:18px}.stat strong{display:block;font-size:23px;color:var(--deep)}.stat small{font-size:11px;color:var(--muted)}.panel{padding:24px}.panel h3{margin:0 0 14px}.sem2{margin:27px 0;padding:24px;border:1px dashed #a8c9db;border-radius:15px;background:#f1f8fc;display:flex;justify-content:space-between;gap:20px;align-items:center}.sem2 strong{color:var(--deep)}.sem2 p{color:var(--muted);font-size:13px;margin:6px 0 0}.crumb{display:flex;gap:10px;align-items:center;color:var(--muted);font-size:12px;margin-bottom:18px}.crumb button{border:0;background:none;color:var(--mid);font-weight:800;padding:0}.chaptertop{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}.chaptertop h1{font-size:27px;margin:4px 0}.chaptertop p{font-size:13px;color:var(--muted);margin:0}.tabs{display:flex;gap:7px;flex-wrap:wrap;background:white;border:1px solid var(--line);border-radius:13px;padding:6px;margin:24px 0 20px}.tabs button{border:0;border-radius:9px;background:transparent;color:#647a91;font-weight:800;padding:11px 19px;font-size:13px}.tabs button.active{background:var(--blue);color:white}.toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:17px}.toolbar label{font-size:12px;color:var(--muted);font-weight:700}.select,.input{border:1px solid #d4e3ef;background:white;border-radius:10px;padding:11px 13px;min-width:180px;max-width:100%;color:var(--ink)}.vocab-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.vocabcard{border:1px solid var(--line);border-radius:14px;padding:20px;background:white}.vocabcard h3{margin:0;font-size:20px;color:var(--deep)}.vocabcard .vi{color:#0977ae;font-weight:800;font-size:14px;margin:6px 0}.vocabcard p{font-size:13px;margin:10px 0;color:#53657e}.vocabcard .ex{border-top:1px solid var(--line);padding-top:12px}.speak{border:0;background:#e4f5ff;color:#007ab7;border-radius:8px;padding:6px 9px;font-size:13px;font-weight:900}.flashbox{border:1px solid #bfe3f5;border-radius:17px;padding:30px;min-height:222px;text-align:center;background:linear-gradient(125deg,#f8fdff,#edf7ff);cursor:pointer}.flashbox .word{font-size:28px;color:var(--deep);font-weight:900}.flashbox .meaning{font-size:21px;color:#0083c6;font-weight:800}.flashbox .hint{font-size:12px;color:var(--muted)}.flashcontrols{display:flex;gap:10px;justify-content:center;margin-top:15px;flex-wrap:wrap}.practice-switch{display:flex;gap:9px;flex-wrap:wrap;margin-bottom:15px}.practice-switch button{border:1px solid #cbdfee;border-radius:10px;background:white;color:var(--deep);padding:10px 14px;font-weight:800;font-size:12px}.practice-switch button.active{background:#e5f5ff;border-color:var(--blue)}.questioncard{max-width:850px;margin:auto;border:1px solid var(--line);border-radius:16px;padding:26px;background:white}.questioncard h3{font-size:17px;font-weight:800;line-height:1.8;margin:15px 0}.optiongrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.option{padding:14px;border-radius:11px;border:1px solid #dce8f2;background:#fff;color:var(--ink);text-align:left;font-weight:650;line-height:1.6}.option:hover{border-color:#62b7e7}.option.correct{border-color:#2fc39b;background:#e8f9f3}.option.wrong{border-color:#e99999;background:#fff0f0}.feedback{border-radius:10px;padding:14px;margin-top:15px;background:#eff8ff;font-size:13px;line-height:1.85}.feedback.success{background:#eaf9f2}.progressline{height:9px;border-radius:10px;background:#e7eef5;overflow:hidden}.progressline span{display:block;height:100%;background:linear-gradient(90deg,#0090cf,#13bda4)}.listlessons{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.lessontag{background:#eff7fc;color:#075d8e;border-radius:9px;padding:7px 10px;font-size:12px;font-weight:750}.discover{padding:24px;margin-bottom:16px}.discover h3{margin:0 0 11px;color:var(--deep);font-size:19px}.discover p{font-size:13px;line-height:1.85;white-space:pre-line}.discover img{max-width:310px;max-height:250px;object-fit:contain;display:block;margin:16px 0;border-radius:10px;border:1px solid #e5ecf6}.foot{border-top:1px solid var(--line);padding:22px 30px;color:var(--muted);font-size:12px;display:flex;gap:12px;justify-content:space-between;flex-wrap:wrap}.katex-display{overflow-x:auto;overflow-y:hidden;padding:7px 0}.empty{padding:26px;text-align:center;background:white;border-radius:12px;color:var(--muted)}.note{padding:14px 17px;border-radius:12px;background:#eaf5fd;border-left:4px solid #07a3e5;font-size:12px;line-height:1.75;color:#35617c}.loading{padding:50px;text-align:center}.answerinput{font-size:16px;padding:12px;border:1px solid #bed5e4;border-radius:10px;width:100%;max-width:360px}.small{font-size:12px;color:var(--muted)}@media(max-width:860px){.grid{grid-template-columns:repeat(2,1fr)}.stats{grid-template-columns:repeat(2,1fr)}.hero h1{font-size:26px}.heroicon{font-size:70px}.main{padding:22px 18px}.header{padding:14px}.vocab-grid{grid-template-columns:1fr}}@media(max-width:580px){.header{position:static;flex-wrap:wrap}.navline{width:100%;justify-content:space-between}.navline button{padding:8px 7px;font-size:11px}.grid,.optiongrid{grid-template-columns:1fr}.hero{padding:28px}.heroicon{display:none}.sem2{display:block}.tabs button{padding:9px 11px;font-size:12px}.chaptertop h1{font-size:23px}.questioncard{padding:17px}}

/* KaTeX display equations on narrow screens, without clipping expressions. */
.katex-display{max-width:100%;overflow-x:auto;overflow-y:hidden;padding:5px 0}
.vocabcard p,.questioncard h3,.questioncard p,.discover p{overflow-wrap:break-word}

/* Vocabulary tab: interactive flip flashcards (all HK1 chapters). */
.flash-study{max-width:800px;margin:12px auto 32px}.flash-toolbar{justify-content:space-between;margin:0 0 13px}.flash-study .progressline{margin-bottom:17px}
.vocab-flashcard{position:relative;min-height:310px;padding:34px 42px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;gap:14px;background:linear-gradient(135deg,#fff,#eaf6ff);border:2px solid #a8d9f4;border-radius:23px;box-shadow:0 12px 30px rgba(0,76,127,.08);cursor:pointer;transition:transform .2s,box-shadow .2s;outline-offset:4px}
.vocab-flashcard:hover{transform:translateY(-2px);box-shadow:0 16px 35px rgba(0,76,127,.12)}.vocab-flashcard:focus-visible{outline:3px solid #008be0}
.vocab-flashcard.is-flipped{background:linear-gradient(135deg,#fff,#f1faff);align-items:stretch;text-align:left}
.flash-side-tag{align-self:flex-start;color:#007caf;font-size:11px;font-weight:900;letter-spacing:.12em}.flash-word{font-size:clamp(26px,4.3vw,42px);font-weight:900;color:var(--deep);overflow-wrap:anywhere}
.flash-meaning{font-size:clamp(22px,3vw,30px);color:var(--deep);margin:0}.flash-en{font-weight:800;color:#147cab;font-size:15px}.flash-ipa{color:var(--muted);font-size:15px}.flash-hint{color:var(--muted);font-size:13px}.flash-flipmark{position:absolute;right:17px;top:14px;font-size:24px;color:#7fbbdb}
.flash-def,.flash-example{font-size:14px;color:#334c69;line-height:1.75;width:100%;overflow-wrap:anywhere}.flash-def strong,.flash-example strong{display:block;color:var(--deep);margin-bottom:5px}.flash-example{border-top:1px solid #d7e9f4;padding-top:10px}.flash-helper{text-align:center;color:var(--muted);font-size:12px;margin-top:14px}
@media(max-width:580px){.vocab-flashcard{padding:27px 22px;min-height:290px}.flash-nav .btn{padding:11px 12px}}

/* Global bilingual vocabulary search */
.global-word-search{display:block;width:100%;max-width:680px;font-size:16px;margin:16px 0 12px}.word-results{display:grid;gap:10px;margin-top:18px}.word-result{display:flex;width:100%;align-items:center;justify-content:space-between;gap:18px;text-align:left;padding:14px 18px;background:#fafdff;border:1px solid #dae9f4;border-radius:13px;color:var(--deep);cursor:pointer;font:inherit}.word-result:hover,.word-result:focus-visible{border-color:#008be0;background:#ebf7ff}.word-result strong{display:block;font-size:15px}.word-result small{display:block;color:#4b6c86;font-size:13px;margin-top:5px}.word-result em{font-size:11px;color:#087cae;font-style:normal;white-space:nowrap}@media(max-width:580px){.word-result{align-items:flex-start;flex-direction:column;gap:8px}}

/* Video lessons organized by chapter */
.videos-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));gap:20px;margin-top:18px}
.video-card{background:#fff;border:1px solid #dce9f3;border-radius:14px;padding:18px;min-width:0}
.video-card h3{margin:2px 0 8px;color:#064e82;font-size:17px}
.video-card .small{line-height:1.6;overflow-wrap:anywhere}
.video-frame{position:relative;width:100%;aspect-ratio:16/9;background:#0c233f;border-radius:10px;overflow:hidden;margin-top:10px}
.video-frame iframe{display:block;width:100%;height:100%;border:0}
.video-empty{margin:22px 0;padding:32px 20px;text-align:center;border:1px dashed #b7d9ed;background:#f4fbff;border-radius:14px}
.video-empty p{color:#59738a}

/* Optional feedback sounds; toggle available only in Practice. */
.practice-switch{display:flex;align-items:center;flex-wrap:wrap;gap:9px}
.practice-sound-toggle{margin-left:auto;border:1px solid #9fc3df;border-radius:10px;background:#f3faff;color:#13537c;padding:10px 13px;font:inherit;font-weight:650;cursor:pointer}
.practice-sound-toggle:hover{background:#e5f3fd}
.practice-sound-toggle:focus-visible{outline:3px solid #087bc2;outline-offset:2px}
@media(max-width:600px){.practice-sound-toggle{margin-left:0}}


/* MathLingo 2026: white / bright-blue visual refresh from reference mockup. */
:root{--blue:#159fe5;--deep:#062e60;--mid:#087fb9;--ink:#123359;--muted:#667b94;--bg:#f8fafc;--line:#e3edf5;--white:#fff;--green:#11a58c;--gold:#f7b743}
body{background:#f8fafc;color:var(--ink)}
.frame{max-width:1380px}
.header{background:#fff;border-bottom:1px solid #e7ebf0;box-shadow:none;padding:18px 32px;gap:20px}
.logo{color:#082c58;font-size:28px;font-weight:900;letter-spacing:-.7px}
.logo span span{color:#082c58}
.logoicon{display:inline-flex;align-items:center;justify-content:center;background:#1da4e5;color:#fff;border-radius:11px;min-height:46px;min-width:46px;padding:0 7px;font-size:32px;font-weight:500;box-shadow:none}
.navline{gap:5px}
.navline button{color:#56647b;font-size:14px;font-weight:750;padding:12px 15px;border-radius:10px}
.navline button.active,.navline button:hover{background:#e9f6fd;color:#087ab5}
.topbadge{background:#eef8fd;color:#0879ad}
.main{padding:34px 32px 70px}
.hero{background:linear-gradient(113deg,#1ea5e8 0%,#1d9bdd 57%,#1389ca 100%);border-radius:16px;min-height:316px;padding:38px 44px;box-shadow:none;color:#fff}
.hero:before{content:none}
.hero-copy{position:relative;z-index:1;max-width:650px;flex:1 1 55%}
.hero .eyebrow{color:#dbf5ff;font-size:13px;font-weight:850;letter-spacing:.1em}
.hero h1{color:#fff;font-size:clamp(30px,3.2vw,44px);font-weight:900;letter-spacing:-1.2px;line-height:1.15;margin:16px 0 18px}
.hero p{max-width:540px;color:#f0faff;font-size:16px;line-height:1.9;margin:0 0 22px}
.hero .btn.white{background:#fff;color:#0079b3;padding:14px 22px;border-radius:9px;font-size:14px;box-shadow:none}
.hero-art{width:42%;max-width:440px;min-width:280px;flex:0 1 42%;align-self:stretch;display:flex;align-items:center;justify-content:center;border-left:3px solid rgba(211,245,255,.75);padding-left:22px;margin:8px 0}
.hero-art svg{display:block;width:100%;height:auto;max-height:260px}
.chaptercard,.panel,.lessoncard,.stat,.discover,.questioncard,.video-card{border:1px solid #e3edf5;box-shadow:0 4px 16px rgba(24,73,120,.035)}
.chaptercard .n{background:#e9f6ff;color:#0684c8}
.chaptercard:hover{border-color:#42b1ef;box-shadow:0 9px 25px rgba(15,111,176,.1)}
.tabs button.active,.btn{background:#159fe5}
.tabs button.active{color:white}
.flashbox,.vocab-flashcard{background:linear-gradient(135deg,#fff,#eaf8ff)}
.vocab-flashcard{border-color:#a6daf4}
.word-result:hover,.word-result:focus-visible{border-color:#1da4e5}
/* Keep the GoatCounter markup and visit-tracking JavaScript untouched. */
@media(max-width:860px){.header{padding:14px 20px}.main{padding:24px 20px 50px}.hero{padding:30px 26px;min-height:285px}.hero-art{min-width:200px;padding-left:13px}.hero h1{font-size:32px}}
@media(max-width:650px){.header{gap:12px}.logo{font-size:23px}.logoicon{min-width:41px;min-height:41px;font-size:27px}.hero{padding:30px 24px;display:block;min-height:0}.hero-copy{max-width:none}.hero h1{font-size:32px}.hero p{font-size:14px;line-height:1.75}.hero-art{border-left:none;border-top:2px solid rgba(211,245,255,.5);margin:22px 0 0;padding:10px 0 0;width:100%;min-width:0;max-width:none}.hero-art svg{max-height:175px}.navline button{font-size:12px;padding:9px 10px}}
