/* Everyday English — v2 design system.
   CI: warm cream default, Nunito, rounded, large type. Wordmark No.1 only, no icon.
   Level colours (rainbow, CI.md): Foundation #EF4444, A1 #F97316, A2 #EAB308,
   B1 #22C55E, B2 #3B82F6, C1 #4F46E5, C2 #8B5CF6.
   Themes are chosen in Settings and stored in localStorage (placeholder for
   a Firestore user profile). */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root{
  --bg:#FFF6E0; --surface:#FFFDF6; --surface-2:#FDEFC9; --surface-3:#FFF1D6;
  --text:#3D2314; --muted:#7A5A44; --muted-2:#9C7B62;
  --primary:#F68A1E; --primary-dark:#D96F0A; --primary-deep:#E85D04;
  --accent:#7A2A1A;
  --border:#F0D9A8; --good:#22C55E; --good-dark:#15803D;
  --radius:20px; --radius-lg:28px;
  --level:#F68A1E;
  --shadow:0 6px 24px rgba(122,42,26,.10);
  --shadow-lg:0 14px 40px rgba(122,42,26,.16);
  --grad-hero:linear-gradient(135deg,#F68A1E 0%,#E85D04 45%,#7A2A1A 100%);
  --grad-news:linear-gradient(135deg,#1E3A5F 0%,#4F46E5 55%,#7C3AED 100%);
  --grad-warm:linear-gradient(135deg,#FFE8B3,#FFD166);
}
html[data-theme="male"]{
  --bg:#EAF2F8; --surface:#FFFFFF; --surface-2:#DCEBF5; --surface-3:#EAF2F8;
  --text:#122A44; --muted:#4A6B8A; --muted-2:#6B8CA8;
  --primary:#0F766E; --primary-dark:#0B5A54; --primary-deep:#0F766E;
  --accent:#1E3A5F;
  --border:#C3D6E8;
  --shadow:0 6px 24px rgba(30,58,95,.12);
  --shadow-lg:0 14px 40px rgba(30,58,95,.18);
  --grad-hero:linear-gradient(135deg,#1E3A5F 0%,#0F766E 60%,#F68A1E 100%);
  --grad-news:linear-gradient(135deg,#122A44 0%,#1E3A5F 55%,#0F766E 100%);
  --grad-warm:linear-gradient(135deg,#DCEBF5,#BFE3DD);
}
html[data-theme="female"]{
  --bg:#FFF5F7; --surface:#FFFFFF; --surface-2:#FDE7F0; --surface-3:#FFF0F5;
  --text:#4A2B3A; --muted:#8A5A74; --muted-2:#A87A96;
  --primary:#EC4899; --primary-dark:#C9337F; --primary-deep:#DB2777;
  --accent:#7C3AED;
  --border:#F5C6DC;
  --shadow:0 6px 24px rgba(124,58,237,.10);
  --shadow-lg:0 14px 40px rgba(124,58,237,.16);
  --grad-hero:linear-gradient(135deg,#F9A8D4 0%,#EC4899 50%,#7C3AED 100%);
  --grad-news:linear-gradient(135deg,#7C3AED 0%,#EC4899 55%,#F9A8D4 100%);
  --grad-warm:linear-gradient(135deg,#FDE7F0,#E9D5FF);
}
html[data-theme="rose"]{
  --bg:#FFF6F1; --surface:#FFFFFF; --surface-2:#FDE8E0; --surface-3:#FFF0E8;
  --text:#4A2C28; --muted:#8A5A52; --muted-2:#A87A70;
  --primary:#E11D48; --primary-dark:#BE123C; --primary-deep:#9F1239;
  --accent:#B45309;
  --border:#F3C9B8;
  --shadow:0 6px 24px rgba(159,18,57,.10);
  --shadow-lg:0 14px 40px rgba(159,18,57,.16);
  --grad-hero:linear-gradient(135deg,#FDE68A 0%,#F43F5E 55%,#9F1239 100%);
  --grad-news:linear-gradient(135deg,#9F1239 0%,#E11D48 55%,#F59E0B 100%);
  --grad-warm:linear-gradient(135deg,#FDE8E0,#FDE68A);
}
html[data-theme="forest"]{
  --bg:#EDF3EC; --surface:#FFFFFF; --surface-2:#DDEADF; --surface-3:#EDF3EC;
  --text:#14261A; --muted:#4A6B52; --muted-2:#6E8A74;
  --primary:#15803D; --primary-dark:#166534; --primary-deep:#14532D;
  --accent:#1F2937;
  --border:#C3D6C6;
  --shadow:0 6px 24px rgba(20,83,45,.12);
  --shadow-lg:0 14px 40px rgba(20,83,45,.18);
  --grad-hero:linear-gradient(135deg,#14532D 0%,#15803D 60%,#D97706 100%);
  --grad-news:linear-gradient(135deg,#14261A 0%,#14532D 55%,#15803D 100%);
  --grad-warm:linear-gradient(135deg,#DDEADF,#FDE68A);
}
*{box-sizing:border-box}
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:'Nunito',system-ui,-apple-system,'Segoe UI',sans-serif;
  font-size:1.125rem; line-height:1.65;
}
body::before{ /* subtle warm dot texture across the whole site */
  content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background-image:radial-gradient(rgba(246,138,30,.07) 1.5px, transparent 1.5px);
  background-size:28px 28px;
}
a{color:var(--primary-dark)}
h1,h2,h3{line-height:1.25;margin:.4em 0 .5em}
h1{font-size:2.1rem;font-weight:900}
h2{font-size:1.5rem;font-weight:800}
h3{font-size:1.2rem;font-weight:800}
p{margin:.5em 0}
.wrap{max-width:1020px;margin:0 auto;padding:0 20px 64px}
.narrow{max-width:720px}

/* ---------- header ---------- */
header.site{
  position:sticky;top:0;z-index:10;background:var(--surface);
  border-bottom:3px solid var(--primary);
  box-shadow:0 4px 18px rgba(122,42,26,.08);
}
header.site .bar{max-width:1020px;margin:0 auto;padding:10px 20px;
  display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.logo img{height:52px;width:auto;display:block;border-radius:12px}
.logo{flex:0 0 auto}
nav.main{display:flex;gap:6px;flex-wrap:wrap;margin-left:auto}
nav.main a{
  display:inline-flex;align-items:center;gap:6px;
  text-decoration:none;color:var(--text);font-weight:800;
  padding:9px 15px;border-radius:999px;
}
nav.main a svg{width:18px;height:18px}
nav.main a:hover{background:var(--surface-2)}
nav.main a.active{background:var(--primary);color:#fff}

/* ---------- generic blocks ---------- */
.card{
  background:var(--surface);border:2px solid var(--border);
  border-radius:var(--radius);padding:22px 24px;margin:18px 0;
  box-shadow:var(--shadow);
}
.card.accent{border-color:var(--level);border-top:8px solid var(--level)}
.card.flat{box-shadow:none}
.pill{
  display:inline-flex;align-items:center;gap:6px;
  padding:5px 13px;border-radius:999px;
  background:var(--surface-2);font-weight:800;font-size:.85rem;
}
.pill svg{width:15px;height:15px}
.pill.level{background:var(--level);color:#fff}
.pill.level[data-level="a2"]{color:#3D2314}
.pill.white{background:rgba(255,255,255,.22);color:#fff}
.btn{
  display:inline-flex;align-items:center;gap:8px;border:0;cursor:pointer;text-decoration:none;
  background:var(--primary);color:#fff;font-weight:900;font-size:1.05rem;
  font-family:inherit;padding:14px 26px;border-radius:999px;
  box-shadow:0 4px 0 var(--primary-dark);
}
.btn svg{width:20px;height:20px}
.btn:hover{filter:brightness(1.06)}
.btn:active{transform:translateY(2px);box-shadow:0 2px 0 var(--primary-dark)}
.btn.ghost{background:var(--surface);color:var(--text);
  border:2px solid var(--border);box-shadow:none}
.btn.white{background:#fff;color:var(--accent);box-shadow:0 4px 0 rgba(0,0,0,.18)}
.btn.google{background:#fff;color:#1f1f1f;border:2px solid #dadce0;box-shadow:0 2px 0 #dadce0}
.btn.apple{background:#111;color:#fff;box-shadow:0 4px 0 #000}
.btn.small{padding:9px 18px;font-size:.95rem}
.muted{color:var(--muted)}
.small{font-size:.92rem}
.grid{display:grid;gap:16px}
.grid.cols2{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.grid.cols3{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}

/* ---------- icons ---------- */
.ic{width:22px;height:22px;flex:0 0 auto}
.ic-tile{
  width:52px;height:52px;border-radius:16px;flex:0 0 auto;
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--surface-2);color:var(--primary-dark);
}
.ic-tile svg{width:28px;height:28px}
.ic-tile.solid{background:var(--primary);color:#fff}
.ic-tile.white{background:rgba(255,255,255,.22);color:#fff}
.ic-tile.level{background:var(--level);color:#fff}
.section-head{display:flex;align-items:center;gap:14px;margin:8px 0 4px}
.section-head h2{margin:0}
.section-head .ic-tile{width:48px;height:48px}
.section-head .ic-tile svg{width:26px;height:26px}

/* ---------- hero / stat chips ---------- */
.hero{
  background:var(--grad-hero);color:#fff;border-radius:var(--radius-lg);
  padding:36px 32px;margin:22px 0 8px;box-shadow:var(--shadow-lg);
  position:relative;overflow:hidden;
}
.hero::after{
  content:"";position:absolute;right:-70px;top:-70px;width:260px;height:260px;
  border-radius:50%;background:rgba(255,255,255,.14);
}
.hero::before{
  content:"";position:absolute;right:60px;bottom:-110px;width:200px;height:200px;
  border-radius:50%;background:rgba(255,255,255,.10);
}
.hero h1{color:#fff;margin:.1em 0 .3em;font-size:2.4rem}
.hero p{color:rgba(255,255,255,.92);max-width:560px}
.hero .logo-band{background:#FFF6E0;border-radius:18px;padding:10px 18px;display:inline-block}
.hero .logo-band img{height:56px;width:auto;display:block}
.hero-badge{
  display:inline-flex;align-items:center;gap:7px;background:rgba(255,255,255,.22);
  border:1px solid rgba(255,255,255,.4);color:#fff;font-weight:800;font-size:.9rem;
  padding:6px 14px;border-radius:999px;
}
.hero-badge svg{width:16px;height:16px}
.stat-chips{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0 4px;position:relative;z-index:1}
.stat-chip{
  display:inline-flex;align-items:center;gap:8px;background:rgba(255,255,255,.18);
  border:1px solid rgba(255,255,255,.35);border-radius:999px;padding:8px 15px;
  font-weight:800;color:#fff;
}
.stat-chip svg{width:18px;height:18px}
.stat-chip b{font-size:1.05rem}

/* ---------- feature cards ---------- */
.feature-card{
  background:var(--surface);border:2px solid var(--border);border-radius:var(--radius);
  padding:22px;box-shadow:var(--shadow);
}
.feature-card h3{margin:12px 0 4px}
.feature-card p{margin:4px 0;color:var(--muted)}
.feature-card .ic-tile{width:56px;height:56px;border-radius:18px}
.feature-card .ic-tile svg{width:30px;height:30px}
.feature-card:nth-child(1) .ic-tile{background:#FFE4C7;color:#D96F0A}
.feature-card:nth-child(2) .ic-tile{background:#DCEBF5;color:#1E3A5F}
.feature-card:nth-child(3) .ic-tile{background:#FDE7F0;color:#C9337F}

/* ---------- level cards: full colour blocks ---------- */
.level-card{
  cursor:pointer;text-decoration:none;color:#fff;display:block;
  background:linear-gradient(145deg,var(--level),color-mix(in srgb,var(--level) 72%,#000));
  border-radius:var(--radius-lg);padding:24px;box-shadow:var(--shadow-lg);
  border:0;position:relative;overflow:hidden;
}
.level-card::after{
  content:"";position:absolute;right:-46px;top:-46px;width:150px;height:150px;
  border-radius:50%;background:rgba(255,255,255,.16);
}
.level-card h3{margin:0;color:#fff;font-size:1.55rem}
.level-card p{color:rgba(255,255,255,.92)}
.level-card .small{color:rgba(255,255,255,.85)}
.level-card .top{display:flex;align-items:center;gap:14px;position:relative;z-index:1}
.level-card .body{position:relative;z-index:1}
.level-card .ring{color:#fff}
.level-card .ring svg circle:first-child{stroke:rgba(255,255,255,.35)}
.level-card .ring svg text{fill:#fff}
.level-card .pill.level{background:rgba(255,255,255,.25);color:#fff;border:1px solid rgba(255,255,255,.5)}
.level-card[data-level="a2"]{color:#3D2314}
.level-card[data-level="a2"] h3{color:#3D2314}
.level-card[data-level="a2"] p,.level-card[data-level="a2"] .small{color:rgba(61,35,20,.85)}
.level-card[data-level="a2"] .pill.level{background:rgba(255,255,255,.55);color:#3D2314;border-color:rgba(61,35,20,.25)}
.level-card[data-level="a2"] .ring{color:#3D2314}
.level-card[data-level="a2"] .ring svg text{fill:#3D2314}
.level-card[data-level="a2"]::after{background:rgba(255,255,255,.35)}
.level-card .progress{height:10px;border-radius:999px;background:rgba(255,255,255,.3);overflow:hidden;margin:14px 0 6px}
.level-card .progress i{display:block;height:100%;background:#fff;border-radius:999px}
.level-card[data-level="a2"] .progress{background:rgba(61,35,20,.18)}
.level-card[data-level="a2"] .progress i{background:#3D2314}
.level-card .go{
  display:inline-flex;align-items:center;gap:7px;font-weight:900;margin-top:8px;
  background:rgba(255,255,255,.22);border:1px solid rgba(255,255,255,.45);
  padding:8px 16px;border-radius:999px;
}
.level-card[data-level="a2"] .go{background:rgba(255,255,255,.5);border-color:rgba(61,35,20,.3)}
.level-card .go svg{width:17px;height:17px}
.level-card.coming{opacity:.75}
.level-card .big-icon{
  position:absolute;right:14px;bottom:12px;width:64px;height:64px;opacity:.28;
}
.level-card .big-icon svg{width:100%;height:100%}

/* level choice buttons on the landing page */
.level-choice{
  border:3px solid var(--border);border-radius:18px;padding:16px;cursor:pointer;
  background:var(--surface);font-family:inherit;color:var(--text);
  text-align:left;position:relative;overflow:hidden;
}
.level-choice::before{content:"";display:block;height:10px;border-radius:999px;
  background:var(--level);margin-bottom:12px}
.level-choice.on{border-color:var(--primary);box-shadow:var(--shadow-lg);transform:translateY(-2px)}
.level-choice:disabled{opacity:.55;cursor:not-allowed}
.level-choice strong{font-size:1.15rem}
.level-choice .ic-tile{width:44px;height:44px;border-radius:13px;margin-bottom:8px}
.level-choice .ic-tile svg{width:24px;height:24px}

/* ---------- news ---------- */
.news-hero{
  background:var(--grad-news);color:#fff;border-radius:var(--radius-lg);
  padding:32px;margin:20px 0;box-shadow:var(--shadow-lg);position:relative;overflow:hidden;
}
.news-hero::after{content:"";position:absolute;right:-60px;bottom:-90px;width:220px;height:220px;
  border-radius:50%;background:rgba(255,255,255,.12)}
.news-hero h1{color:#fff;margin:.3em 0;font-size:2rem}
.news-hero p{color:rgba(255,255,255,.9)}
.news-hero .meta{color:rgba(255,255,255,.85);font-weight:700}
.vocab-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin:12px 0}
.vocab-card{
  background:var(--surface-2);border:2px solid var(--border);border-left:8px solid var(--primary);
  border-radius:16px;padding:14px 16px;
}
.vocab-card .word{font-size:1.2rem;font-weight:900}
.vocab-card .ipa{color:var(--muted);font-weight:700;font-size:.92rem}
.vocab-card p{margin:4px 0}
.grammar-block{
  background:var(--surface-3);border:2px solid var(--border);border-left:8px solid var(--level,#F68A1E);
  border-radius:16px;padding:16px 18px;margin:12px 0;
}
.grammar-block h3{margin-top:0}
.num-list{counter-reset:item;list-style:none;padding:0}
.num-list li{
  counter-increment:item;position:relative;padding:12px 12px 12px 52px;margin:10px 0;
  background:var(--surface-2);border-radius:14px;
}
.num-list li::before{
  content:counter(item);position:absolute;left:10px;top:10px;width:30px;height:30px;
  border-radius:50%;background:var(--primary);color:#fff;font-weight:900;
  display:flex;align-items:center;justify-content:center;
}

/* ---------- day / lesson ---------- */
.ring{flex:0 0 auto}
.ring svg{display:block}
.ring .pct{font-weight:900;font-size:.9rem}
.visited-dot{
  display:inline-flex;align-items:center;gap:6px;font-weight:800;font-size:.9rem;
}
.visited-dot .dot{width:12px;height:12px;border-radius:50%;background:#D8C9A8;display:inline-block}
.visited-dot.done{color:var(--good-dark)}
.visited-dot.done .dot{background:var(--good)}
.day-row{
  display:flex;align-items:center;gap:12px;padding:12px 6px;
  border-bottom:1px solid var(--border);text-decoration:none;color:inherit;
}
.day-row:hover{background:var(--surface-2);border-radius:12px}
.day-row .n{
  width:44px;height:44px;border-radius:50%;flex:0 0 auto;
  display:flex;align-items:center;justify-content:center;
  background:var(--surface-2);font-weight:900;
}
.day-row .n svg{width:22px;height:22px}
.day-row.done .n{background:var(--good);color:#fff}
.day-row .t{flex:1}
.tabs{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
.tab{
  display:inline-flex;align-items:center;gap:7px;
  border:2px solid var(--border);background:var(--surface);
  font-family:inherit;font-weight:800;font-size:1rem;color:var(--text);
  padding:10px 16px;border-radius:999px;cursor:pointer;
}
.tab svg{width:18px;height:18px}
.tab.active{background:var(--level,#F68A1E);border-color:var(--level,#F68A1E);color:#fff}
.tabpane{display:none}
.tabpane.active{display:block}
.flashcard{
  background:var(--surface-2);border:2px solid var(--border);
  border-top:8px solid var(--level,#F68A1E);
  border-radius:16px;padding:20px;margin:10px 0;
}
.flashcard .word{font-size:1.6rem;font-weight:900}
.flashcard .ipa{color:var(--muted);font-weight:700}
.flashcard .num-badge{
  display:inline-flex;align-items:center;justify-content:center;
  width:34px;height:34px;border-radius:50%;background:var(--level,#F68A1E);color:#fff;
  font-weight:900;margin-right:8px;vertical-align:middle;
}
.lesson-head{
  background:linear-gradient(135deg,var(--level),color-mix(in srgb,var(--level) 70%,#000));
  color:#fff;border-radius:var(--radius-lg);padding:26px 28px;margin:18px 0;box-shadow:var(--shadow-lg);
}
.lesson-head[data-level="a2"]{color:#3D2314}
.lesson-head[data-level="a2"] h1{color:#3D2314}
.lesson-head[data-level="a2"] .pill.level{background:rgba(255,255,255,.55);color:#3D2314}
.lesson-head h1{color:#fff;margin:.2em 0}
.lesson-head .pill.level{background:rgba(255,255,255,.25);color:#fff;border:1px solid rgba(255,255,255,.5)}
.kv{display:grid;grid-template-columns:1fr 2fr;gap:6px 14px}
.kv dt{font-weight:900}
.kv dd{margin:0}
.notice{
  background:#FFF3CD;border:2px dashed #D9A406;border-radius:14px;
  padding:14px 18px;margin:16px 0;font-size:.95rem;
}
label{display:block;font-weight:800;margin:14px 0 6px}
select,input[type="time"]{
  font-family:inherit;font-size:1.05rem;padding:10px 14px;
  border:2px solid var(--border);border-radius:12px;background:var(--surface);
  color:var(--text);width:100%;max-width:320px;
}
.steps{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}
.step{
  flex:1;min-width:140px;text-align:center;padding:14px 12px;border-radius:16px;
  background:var(--surface);border:2px solid var(--border);font-weight:800;
}
.step .step-num{
  display:inline-flex;align-items:center;justify-content:center;
  width:30px;height:30px;border-radius:50%;background:var(--surface-2);
  margin-right:6px;font-weight:900;
}
.step.on{background:var(--primary);border-color:var(--primary);color:#fff}
.step.on .step-num{background:rgba(255,255,255,.25);color:#fff}
blockquote{
  margin:12px 0;padding:16px 20px;border-left:6px solid var(--primary);
  background:var(--surface-2);border-radius:0 14px 14px 0;font-style:italic;
}
footer.site{border-top:2px solid var(--border);padding:20px;text-align:center}
.theme-pick{display:flex;gap:12px;flex-wrap:wrap}
.theme-group{flex:1 1 100%;font-weight:900;margin:8px 0 0}
.theme-swatch{
  border:3px solid var(--border);border-radius:16px;padding:0;cursor:pointer;overflow:hidden;
  background:var(--surface);font-family:inherit;font-weight:800;color:var(--text);
  min-width:170px;text-align:left;
}
.theme-swatch.on{border-color:var(--primary);box-shadow:var(--shadow-lg)}
.theme-swatch .preview{height:74px}
.theme-swatch .preview.warm{background:linear-gradient(135deg,#FFF6E0 0%,#F68A1E 60%,#7A2A1A 100%)}
.theme-swatch .preview.navy{background:linear-gradient(135deg,#EAF2F8 0%,#1E3A5F 55%,#0F766E 100%)}
.theme-swatch .preview.pink{background:linear-gradient(135deg,#FFF5F7 0%,#F9A8D4 55%,#7C3AED 100%)}
.theme-swatch .preview.rose{background:linear-gradient(135deg,#FFF6F1 0%,#F43F5E 55%,#B45309 100%)}
.theme-swatch .preview.forest{background:linear-gradient(135deg,#EDF3EC 0%,#14532D 55%,#D97706 100%)}
.theme-swatch .label{padding:12px 14px}
.theme-swatch .dots{display:flex;gap:6px;margin-bottom:8px}
.theme-swatch .dots i{width:22px;height:22px;border-radius:50%;display:block;border:1px solid rgba(0,0,0,.12)}
.unit-head{
  display:flex;gap:14px;align-items:center;
  background:var(--surface-2);border:2px solid var(--border);border-left:8px solid var(--level,#F68A1E);
  border-radius:16px;padding:16px 18px;margin:14px 0;
}
@media (max-width:600px){
  body{font-size:1.0625rem}h1{font-size:1.7rem}.logo img{height:42px}
  .hero{padding:26px 20px}.hero h1{font-size:1.9rem}
  .news-hero{padding:24px 20px}
  .kv{grid-template-columns:1fr}
}

/* ---------- v2 layout correction: Foundation is a full-width featured card ----------
   Order top to bottom: Foundation (full width), A1 | A2, B1 | B2, C1 | C2.
   No 2-column grid with a lone C2 and an empty cell. */
.level-choice.featured{
  grid-column:1 / -1;
  background:linear-gradient(135deg,#EF4444 0%,#DC2626 55%,#991B1B 100%);
  color:#fff;border:0;padding:24px 26px;
  display:flex;flex-direction:column;align-items:flex-start;gap:2px;
}
.level-choice.featured::before{background:rgba(255,255,255,.55)}
.level-choice.featured strong{font-size:1.5rem;color:#fff}
.level-choice.featured .muted,.level-choice.featured .small{color:rgba(255,255,255,.92)}
.level-choice.featured .ic-tile{background:rgba(255,255,255,.22);color:#fff}
.level-choice.featured .start-badge{
  display:inline-flex;align-items:center;gap:6px;background:#fff;color:#991B1B;
  font-weight:900;font-size:.85rem;padding:5px 13px;border-radius:999px;margin-bottom:6px;
}
.start-badge svg{width:15px;height:15px;flex:0 0 auto}
.level-choice.featured.on{box-shadow:0 0 0 4px #fff,0 0 0 7px var(--primary);transform:none}
.level-card.featured{grid-column:1 / -1;padding:30px 32px}
.level-card.featured h3{font-size:2rem}
.level-card.featured .start-badge{
  display:inline-flex;align-items:center;gap:6px;background:rgba(255,255,255,.25);
  border:1px solid rgba(255,255,255,.5);color:#fff;
  font-weight:900;font-size:.85rem;padding:5px 13px;border-radius:999px;margin-bottom:10px;
}
/* A2 yellow: dark text on its lesson header, and a dark progress bar. */
.lesson-head[data-level="a2"] p{color:rgba(61,35,20,.85)}
.lesson-head[data-level="a2"] .progress{background:rgba(61,35,20,.18)}

/* ================= v3 — full-width web layout + app-ready navigation ================ */
/* James, 2026-11-20: web must fill the whole page (no narrow centre column);
   mobile must adapt to a phone aspect ratio; the site will become an app, so
   the same 5 destinations are the app's tab bar. Breakpoints: 1024px and 640px. */
html,body{overflow-x:hidden}
.wrap{max-width:1360px;padding:0 32px 64px}
.narrow{max-width:880px}
header.site .bar{max-width:1360px;padding:10px 32px}
.header-cta{margin-left:8px}
nav.main a.active{background:var(--primary);color:#fff}

/* Full-bleed heroes: edge-to-edge bands inside the wide wrap. */
.fullbleed{
  width:100vw;max-width:100vw;
  margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);
  border-radius:0;
  padding-left:max(32px,calc((100vw - 1360px)/2 + 32px));
  padding-right:max(32px,calc((100vw - 1360px)/2 + 32px));
}
.hero.fullbleed,.news-hero.fullbleed{box-shadow:none}

/* Grids that stretch across the page. */
.grid.cols3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid.cols4{grid-template-columns:repeat(4,minmax(0,1fr))}
.grid.cols2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.cols2.wide{grid-template-columns:repeat(2,minmax(0,1fr))}

/* Two-column content + right sidebar (home / level / day on desktop). */
.layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:24px;align-items:start}
.layout-main{min-width:0}
.sidebar{position:sticky;top:88px;display:flex;flex-direction:column;gap:16px}
.sidebar .card{margin:0}
.sidebar h3{margin:0 0 6px}
.side-link{display:flex;align-items:center;gap:10px;padding:10px 4px;border-bottom:1px solid var(--border);text-decoration:none;color:inherit;font-weight:800}
.side-link:last-child{border-bottom:0}
.side-link svg{width:20px;height:20px;color:var(--primary-dark)}
.side-link small{display:block;font-weight:600;color:var(--muted)}

/* Stat row: 3–4 tiles across the full width. */
.stat-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:18px 0}
.stat-tile{background:var(--surface);border:2px solid var(--border);border-radius:var(--radius);padding:18px 20px;box-shadow:var(--shadow)}
.stat-tile .num{font-size:1.9rem;font-weight:900;line-height:1.1}
.stat-tile .lbl{font-weight:800;color:var(--muted)}
.stat-tile .ic-tile{margin-bottom:8px}

/* Supplement cards (hub + detail). Colour comes from the registry entry. */
.supp-card{
  display:block;text-decoration:none;color:inherit;background:var(--surface);
  border:2px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;
  box-shadow:var(--shadow);
}
.supp-card .band{height:12px;background:var(--surface-2);border-bottom:2px solid var(--border)}
.supp-card .body{padding:20px 22px}
.supp-card h3{margin:10px 0 2px}
.supp-card .zh{font-weight:800;color:var(--muted)}
.supp-card p{color:var(--muted)}
.supp-card .ic-tile{background:var(--surface-2);color:var(--text);border:2px solid var(--border)}
.supp-card .go{font-weight:900;color:var(--primary-dark)}
.level-chips{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
.level-chip{
  display:inline-flex;align-items:center;gap:6px;text-decoration:none;
  border:2px solid var(--border);background:var(--surface);color:var(--text);
  font-weight:800;padding:9px 16px;border-radius:999px;font-family:inherit;cursor:pointer;
}
.level-chip .dot{width:12px;height:12px;border-radius:50%;background:var(--level,#F68A1E)}
.level-chip.active{background:var(--text);border-color:var(--text);color:var(--surface)}
.level-chip.active .dot{background:#fff}

/* IA strip: News / Main Course / Supplements / Review cards on landing + courses. */
.ia-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:18px 0}
.ia-card{display:block;text-decoration:none;color:inherit;background:var(--surface);border:2px solid var(--border);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow)}
.ia-card h3{margin:10px 0 4px}
.ia-card p{margin:0;color:var(--muted)}
.ia-card .step-no{font-size:.85rem;font-weight:900;color:var(--primary-dark);letter-spacing:.04em}

/* Mobile bottom tab bar — the app's tab bar. Hidden on desktop. */
.tabbar{
  display:none;position:fixed;left:0;right:0;bottom:0;z-index:50;
  background:var(--surface);border-top:2px solid var(--border);
  padding:6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow:0 -6px 24px rgba(122,42,26,.10);
}
.tabbar a{
  flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;
  text-decoration:none;color:var(--muted);font-weight:800;font-size:.78rem;
  padding:6px 2px;border-radius:12px;min-height:52px;justify-content:center;
}
.tabbar a svg{width:24px;height:24px}
.tabbar a.active{color:var(--primary-dark)}
.tabbar a.active svg{color:var(--primary)}

/* ---------- breakpoints ---------- */
@media (max-width:1024px){
  .wrap{padding:0 24px 64px}
  header.site .bar{padding:10px 24px}
  nav.main{display:none}              /* top nav links move to the bottom tab bar */
  .header-cta{display:none}
  .tabbar{display:flex}
  body{padding-bottom:72px}           /* keep footer/content clear of the tab bar */
  .layout{grid-template-columns:minmax(0,1fr)}
  .sidebar{position:static}
  .grid.cols4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ia-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stat-row{grid-template-columns:repeat(2,minmax(0,1fr))}
  .level-card.featured{padding:24px}
}
@media (max-width:640px){
  body{font-size:1.0625rem}
  .wrap{padding:0 16px 64px}
  header.site .bar{padding:8px 16px}
  .logo img{height:40px}
  .grid.cols2,.grid.cols3,.grid.cols4,.ia-strip,.stat-row{grid-template-columns:minmax(0,1fr)}
  .hero{padding:26px 20px}
  .hero h1{font-size:1.9rem}
  .news-hero{padding:24px 20px}
  .fullbleed{padding-left:16px;padding-right:16px}
  .btn{padding:13px 20px}
  .tabbar a{font-size:.72rem;min-height:56px}
  .level-choice.featured{padding:20px}
}

/* Read aloud (news lesson, v3.1): one Listen button per paragraph, never read-all. */
.read-controls{display:flex;gap:10px;align-items:center;flex-wrap:wrap;background:var(--surface-2);border:2px solid var(--border);border-radius:14px;padding:10px 14px;margin:0 0 18px}
.read-controls label{font-weight:800;margin:0}
.read-controls select{width:auto;max-width:160px;padding:8px 10px}
.listen-btn{display:inline-flex;align-items:center;gap:6px;border:2px solid var(--primary);background:#fff;color:var(--primary-dark);font-family:inherit;font-weight:900;font-size:1rem;min-height:44px;padding:10px 16px;border-radius:999px;cursor:pointer;margin:0 8px 4px 0;vertical-align:middle}
.listen-btn svg{width:16px;height:16px;flex:0 0 auto}
.listen-btn:hover{background:var(--surface-2)}
.listen-btn.playing{background:var(--primary);border-color:var(--primary);color:#fff}
.speaking{background:var(--surface-2);border-radius:12px;box-shadow:inset 0 0 0 2px var(--primary)}
blockquote.speaking,li.speaking{padding-left:14px}

/* Text size control (header on every page + Settings card). 44px tap targets. */
.font-size{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.font-size-label{font-weight:800;font-size:.9rem}
.font-size button{min-height:44px;min-width:44px;padding:8px 12px;border:2px solid var(--border);background:#fff;color:var(--text);border-radius:12px;font-family:inherit;font-weight:900;cursor:pointer}
.font-size button[data-font-size="xsmall"]{font-size:.85rem}
.font-size button[data-font-size="small"]{font-size:.95rem}
.font-size button[data-font-size="large"]{font-size:1.1rem}
.font-size button[data-font-size="extra"]{font-size:1.25rem}
.font-size button.active{background:var(--primary);border-color:var(--primary);color:#fff}
.font-size button:focus-visible{outline:3px solid var(--primary);outline-offset:2px}

/* How-to strip: 3 plain steps at the top of a page, so any learner knows what to do. */
.howto{display:flex;gap:12px;flex-wrap:wrap;background:var(--surface-2);border:2px solid var(--border);border-radius:14px;padding:12px 16px;margin:14px 0;font-weight:800}
.howto b{color:var(--primary-dark)}

/* Collapsible units on level pages: only the next unit starts open. */
details.unit summary{cursor:pointer;list-style:none}
details.unit summary::-webkit-details-marker{display:none}
details.unit summary:focus-visible{outline:3px solid var(--primary);outline-offset:2px;border-radius:16px}
details.unit .unit-hint{font-size:.9rem;color:var(--muted);font-weight:800;white-space:nowrap}
details.unit[open] .unit-hint{display:none}

/* Tappable words: tap any .speakable word to hear it. */
.speakable{cursor:pointer}
.speakable:focus-visible{outline:3px solid var(--primary);outline-offset:2px;border-radius:8px}

/* Registration gate: News is free, courses need an account. */
.gate-overlay{position:fixed;inset:0;background:rgba(61,35,20,.55);display:flex;align-items:flex-start;justify-content:center;padding:24px;z-index:200;overflow:auto}
.gate-card{background:var(--surface);border-radius:var(--radius-lg);max-width:520px;width:100%;padding:28px;box-shadow:var(--shadow-lg);margin-top:6vh}
.gate-card h2{margin-top:0}
.gate-card label{display:block;font-weight:800;margin:14px 0 4px}
.gate-card input{width:100%;font-family:inherit;font-size:1.05rem;padding:12px 14px;border:2px solid var(--border);border-radius:12px;background:#fff}
.gate-card input:focus{outline:3px solid var(--primary);outline-offset:1px}
.gate-card .btn{margin-top:14px}
.account-chip{display:inline-flex;align-items:center;gap:6px;font-weight:800;color:var(--text);text-decoration:none;padding:8px 12px;border:2px solid var(--border);border-radius:999px;background:var(--surface);white-space:nowrap}
.account-chip:hover{border-color:var(--primary)}

/* ---------- Header: fixed two-row layout (2026-11-20) ----------
   Text size (A-- / A- / A / A+ / A++) must never move the header around: the header
   is chrome, so its controls are fixed px sizes and fixed positions, while
   only the page content below grows with the text-size setting.
   Row 1: logo | nav | account | Start learning. Row 2: text-size buttons,
   always on their own row, right-aligned, same place at every text size. */
header.site .bar{flex-wrap:wrap;row-gap:0}
header.site .bar .logo{order:1;flex:0 0 auto}
header.site .bar nav.main{order:2;flex:0 1 auto}
header.site .bar nav.main a{font-size:16px;white-space:nowrap}
header.site .bar .account-chip{order:3;flex:0 0 auto;font-size:15px;padding:8px 14px;white-space:nowrap}
header.site .bar .header-cta{order:4;flex:0 0 auto;font-size:15px;padding:10px 18px;white-space:nowrap}
header.site .bar .font-size{order:10;flex:1 1 100%;justify-content:flex-end;padding:8px 0 6px;margin-top:8px;border-top:2px solid var(--border)}
.font-size-label{font-size:15px}
.font-size button{height:44px;min-width:48px;font-size:16px}
.font-size button[data-font-size="large"]{font-size:18px}
.font-size button[data-font-size="extra"]{font-size:20px}

/* ---------- Header v2 (2026-11-20): big logo left, text size far right ----------
   One row when it fits: logo | nav | account | Start learning | Text size.
   The header wraps only when the screen is too narrow, and then Text size
   always lands on its own row, right-aligned — never in the middle, never jumping. */
header.site .bar{max-width:1440px;flex-wrap:wrap}
header.site .bar .logo{order:1}
header.site .bar nav.main{order:2;margin-left:auto}
header.site .bar .account-chip{order:3}
header.site .bar .header-cta{order:4}
header.site .bar .font-size{order:5;flex:0 0 auto;padding:0;margin:0 0 0 auto;border-top:0}
.logo img{height:120px}
@media (max-width:1440px){
  .logo img{height:96px}
  header.site .bar nav.main a{padding:8px 10px}
  .font-size-label{display:none}
}
@media (max-width:1024px){
  .logo img{height:88px}
}
@media (max-width:640px){
  header.site .bar .font-size{order:10;flex:1 1 100%;justify-content:flex-end;padding:6px 0 2px;margin-left:0}
  .logo img{height:72px}
}

/* ---------- Header logo: full-height wordmark (2026-11-20, JR) ----------
   Wide screens only: the logo spans from the News row down to the orange
   line — its top no higher than the nav row, its bottom on the header's
   bottom border, as large as fits (180px). The logo is absolutely
   positioned, so the bar gets a fixed min-height and the two rows spread
   top (nav) / bottom (text size). The SVG viewBox is cropped to the
   artwork so the element box is the visible letters, not empty margins. */
/* Middle function strip: hidden below 1441px (wide screens only).
   NOTE: this base rule must stay BEFORE the wide media block — same
   specificity, so source order decides, and the block's display:flex
   has to win at wide widths. */
.header-status{display:none}
@media (min-width:1441px){
  header.site .bar{position:relative;min-height:220px;align-content:space-between}
  /* Logo: the visible letters' top edge sits on the News text's top edge;
     the bottom sits on the orange line. 200px tall, 437px wide. */
  header.site .bar .logo{position:absolute;left:32px;top:20px}
  .logo img{height:200px}
  /* Tighter nav links so the wider logo clears the nav. */
  header.site .bar nav.main a{padding:8px 10px}
  /* Text size stays on its own bottom row (it would fit up top now that
     the logo is out of flow — keep it where it was, above the orange line).
     No divider above it: the full-width line was the stray line across
     the middle of the header. */
  header.site .bar .font-size{order:10;flex:1 1 100%;justify-content:flex-end;padding:8px 0 6px;margin-top:8px;border-top:0}
  /* Middle function strip: search + up next. Fills the band between the
     nav row and the text-size row; hidden below 1441px. */
  .header-status{display:flex;align-items:center;gap:20px;position:absolute;right:32px;top:50%;transform:translateY(-50%);max-width:860px}
  .header-search{position:relative;flex:0 0 250px}
  .header-search input{width:100%;font:inherit;font-size:15px;font-weight:700;padding:10px 14px;border:2px solid var(--border);border-radius:999px;background:#fff;color:var(--text)}
  .header-search input:focus{outline:3px solid var(--primary);outline-offset:1px}
  .header-search-results{position:absolute;top:calc(100% + 6px);left:0;right:0;background:#fff;border:2px solid var(--border);border-radius:14px;box-shadow:0 8px 24px rgba(122,42,26,.16);overflow:hidden;z-index:20}
  .header-search-results a{display:block;padding:10px 14px;text-decoration:none;color:var(--text);font-weight:800;border-top:1px solid var(--border)}
  .header-search-results a:first-child{border-top:0}
  .header-search-results a small{display:block;font-weight:600;opacity:.65}
  .header-search-results a:hover{background:var(--surface-2)}
  .header-next{display:flex;flex-direction:column;gap:2px;min-width:0}
  .header-next-label{font-size:12px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:var(--primary)}
  .header-next-link{font-weight:900;color:var(--text);text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:520px}
  .header-next-link:hover{color:var(--primary);text-decoration:underline}
  .header-next-progress{font-size:13px;opacity:.7;white-space:nowrap}
}

/* ---------- Saved cards (2026-11-21, JR) ----------
   Save for later: a bookmark button on every lesson and supplement card.
   Saved cards collect in Review, with a Got it / Still hard drill. */
.save-btn{display:inline-flex;align-items:center;gap:6px;margin:10px 0 2px;padding:6px 12px;border:2px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text);font:inherit;font-size:.9rem;font-weight:800;cursor:pointer}
.save-btn svg{width:16px;height:16px}
.save-btn:hover{border-color:var(--primary)}
.save-btn.saved{background:var(--primary);border-color:var(--primary);color:#fff}
.saved-item{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:12px 0;border-top:2px solid var(--border)}
.saved-item:first-of-type{border-top:0}
.saved-actions{flex:0 0 auto;display:flex;gap:8px}
.drill-card{margin-top:12px;padding:20px;border:2px solid var(--primary);border-radius:16px;background:var(--surface)}
.drill-card .word{font-size:1.5rem;font-weight:900;margin:6px 0}
.drill-done{margin-top:12px;padding:16px;border:2px solid var(--border);border-radius:16px}
