/* ============================================================
   Français A0 → A1 — stylesheet
   Fresh, clean, mobile-first. Light + dark theme.
   ============================================================ */

:root{
  --bg:#f4f6fb;
  --bg-2:#eaeffa;
  --card:#ffffff;
  --card-2:#f8faff;
  --ink:#131a2b;
  --ink-2:#3d4761;
  --muted:#6b7591;
  --line:#e2e7f2;
  --line-2:#cfd7ea;

  --blue:#1b3fa0;
  --blue-m:#2f5fd0;
  --blue-l:#e8effd;
  --blue-xl:#f2f6ff;
  --red:#d92b40;
  --red-l:#fdecee;
  --green:#128a54;
  --green-l:#e6f7ee;
  --gold:#c88a00;
  --gold-l:#fff8e2;
  --purple:#6b3fd4;
  --purple-l:#f1ecff;

  --grad:linear-gradient(120deg,#12296b 0%,#1b3fa0 42%,#2f5fd0 62%,#d92b40 100%);

  --r-sm:10px; --r:14px; --r-lg:20px;
  --sh-1:0 1px 2px rgba(19,26,43,.05), 0 1px 3px rgba(19,26,43,.06);
  --sh-2:0 4px 14px rgba(19,26,43,.08);
  --sh-3:0 12px 34px rgba(19,26,43,.13);

  --nav-h:60px;
  --side-w:286px;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
  --urdu:"Noto Nastaliq Urdu","Jameel Noori Nastaleeq","Noto Naskh Arabic","Noto Sans Arabic",serif;
}

[data-theme="dark"]{
  --bg:#0d1220;
  --bg-2:#141b2e;
  --card:#161d30;
  --card-2:#1b2438;
  --ink:#eef2fb;
  --ink-2:#c7cfe2;
  --muted:#8f9ab5;
  --line:#28324a;
  --line-2:#35406040;

  --blue:#7ba3ff;
  --blue-m:#5c8bfa;
  --blue-l:#1d2a4d;
  --blue-xl:#18213a;
  --red:#ff7a89;
  --red-l:#3a1d24;
  --green:#4fd39a;
  --green-l:#12301f;
  --gold:#ffcc4d;
  --gold-l:#332a10;
  --purple:#b39bff;
  --purple-l:#241d3f;

  --grad:linear-gradient(120deg,#0f1c44 0%,#1b3fa0 45%,#2f5fd0 65%,#a82133 100%);
  --sh-1:0 1px 2px rgba(0,0,0,.4);
  --sh-2:0 4px 16px rgba(0,0,0,.45);
  --sh-3:0 14px 40px rgba(0,0,0,.55);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue","Noto Sans",sans-serif;
  font-size:16px; line-height:1.6; -webkit-font-smoothing:antialiased;
}
a{color:var(--blue); text-decoration:none}
a:hover{text-decoration:underline}
.hidden{display:none !important}
.small{font-size:.85rem; color:var(--muted)}
.ur{font-family:var(--urdu); direction:rtl; unicode-bidi:embed; font-size:1.06em; line-height:2}
[dir="rtl"] .ur{text-align:right}
.mono{font-family:var(--mono); overflow-wrap:anywhere}

/* ---------------- TOP BAR ---------------- */
.topbar{position:sticky; top:0; z-index:40; color:#fff; background:var(--grad); box-shadow:0 2px 16px rgba(10,18,45,.25)}
/* NOTE: do not use var(--nav-h) here — --nav-h is measured FROM this element,
   so a min-height based on it would feed back and inflate the header. */
.bar1{display:flex; align-items:center; gap:12px; padding:9px 14px; min-height:60px}
.brand{display:flex; align-items:center; gap:10px; color:#fff; min-width:0; flex-shrink:0}
.brand:hover{text-decoration:none}
.fr-flag{width:38px; height:26px; border-radius:5px; flex-shrink:0; box-shadow:0 1px 4px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.25); overflow:hidden; display:block}
.brand-title{font-weight:800; font-size:1.05rem; letter-spacing:.2px; line-height:1.15; white-space:nowrap}
.brand-sub{font-size:.72rem; opacity:.85; white-space:nowrap}
#menuBtn{display:none; background:rgba(255,255,255,.16); border:none; color:#fff; font-size:1.25rem; border-radius:9px; padding:5px 11px; cursor:pointer}
#menuBtn:hover{background:rgba(255,255,255,.28)}

/* global search in header */
.gsearch{position:relative; flex:1; min-width:120px; max-width:460px; margin-left:auto}
.gsearch input{
  width:100%; padding:9px 14px 9px 38px; border-radius:999px; border:none; font-size:.92rem;
  background:rgba(255,255,255,.96); color:#131a2b; outline:none;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.5);
}
.gsearch input::placeholder{color:#7b8499}
.gsearch .icos{position:absolute; left:13px; top:50%; transform:translateY(-50%); font-size:.95rem; opacity:.6; pointer-events:none}
.gsearch-res{
  position:absolute; top:calc(100% + 8px); left:0; right:0; max-height:66vh; overflow-y:auto;
  background:var(--card); color:var(--ink); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--sh-3); padding:8px; z-index:60;
}
.gs-item{display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:var(--r-sm); cursor:pointer}
.gs-item:hover{background:var(--blue-xl)}
.gs-fr{font-weight:800; min-width:120px}
.gs-pr{font-family:var(--mono); font-size:.78rem; color:var(--blue); background:var(--blue-l); padding:1px 7px; border-radius:6px}
.gs-en{color:var(--ink-2); font-size:.9rem}
.gs-src{margin-left:auto; font-size:.72rem; color:var(--muted); white-space:nowrap}
.gs-empty{padding:12px; color:var(--muted); font-size:.9rem}

/* header buttons */
.hbtns{display:flex; align-items:center; gap:8px; flex-shrink:0}
.hbtn{
  display:inline-flex; align-items:center; gap:7px; padding:8px 13px; border-radius:999px;
  border:1px solid rgba(255,255,255,.4); background:rgba(255,255,255,.13); color:#fff;
  font-size:.85rem; font-weight:600; cursor:pointer; white-space:nowrap; transition:background .15s;
}
.hbtn:hover{background:rgba(255,255,255,.26)}
.flag-dot{width:16px; height:16px; border-radius:50%; background:var(--blue-m); display:inline-flex; align-items:center; justify-content:center; font-size:.62rem; font-weight:800}

.settings{border-top:1px solid rgba(255,255,255,.22); padding:10px 16px 12px; display:flex; gap:20px; flex-wrap:wrap; align-items:center; font-size:.82rem}
.settings label{display:flex; flex-direction:column; gap:3px; opacity:.95}
.settings select,.settings input[type=range]{min-width:170px; border-radius:8px; border:none; padding:4px 7px; font-size:.82rem; background:rgba(255,255,255,.95); color:#131a2b}
.settings .row-inline{display:flex; align-items:center; gap:8px}

/* ---------------- LAYOUT ---------------- */
.layout{display:flex; align-items:flex-start; min-height:calc(100vh - var(--nav-h))}

.sidebar{
  width:var(--side-w); flex-shrink:0; background:var(--card); border-right:1px solid var(--line);
  padding:12px 10px 40px; position:sticky; top:var(--nav-h); height:calc(100vh - var(--nav-h));
  overflow-y:auto; overscroll-behavior:contain;
}
.sidebar::-webkit-scrollbar{width:9px}
.sidebar::-webkit-scrollbar-thumb{background:var(--line-2); border-radius:9px}

.side-block{margin-bottom:14px}
.side-title{font-size:.72rem; text-transform:uppercase; letter-spacing:.09em; font-weight:800; color:var(--muted); padding:8px 10px 5px}
.side-search input{
  width:100%; padding:9px 12px; border-radius:var(--r-sm); border:1px solid var(--line);
  background:var(--card-2); color:var(--ink); font-size:.88rem; outline:none;
}
.side-search input:focus{border-color:var(--blue-m)}

.side-meter{background:var(--card-2); border:1px solid var(--line); border-radius:var(--r); padding:11px 13px; margin:0 4px 12px}
.side-meter .top{display:flex; justify-content:space-between; align-items:baseline; font-size:.8rem; color:var(--muted); margin-bottom:6px}
.side-meter .big{font-size:1.3rem; font-weight:800; color:var(--blue)}
.bar{height:9px; background:var(--line); border-radius:99px; overflow:hidden}
.bar-fill{height:100%; width:0; border-radius:99px; background:linear-gradient(90deg,var(--green),#4fd39a); transition:width .35s ease}

#navList{list-style:none; padding:0; margin:0}
#navList li{margin:1px 0}
.nav-group{
  margin:14px 10px 5px; font-size:.7rem; text-transform:uppercase; letter-spacing:.09em;
  color:var(--muted); font-weight:800; display:flex; align-items:center; gap:7px;
}
.nav-group .cnt{background:var(--line); color:var(--ink-2); border-radius:99px; padding:0 7px; font-size:.66rem; font-weight:700}
.nav-group::after{content:""; flex:1; height:1px; background:var(--line)}

/* --- THE LESSON BUTTONS (highlighted, easy to find) --- */
#navList a{
  display:flex; align-items:center; gap:9px; padding:8px 10px 8px 11px; border-radius:var(--r-sm);
  color:var(--ink-2); font-size:.9rem; position:relative; border-left:3px solid transparent;
  transition:background .13s, border-color .13s, color .13s;
}
#navList a:hover{background:var(--blue-xl); color:var(--ink); text-decoration:none}
#navList a .lbl{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
#navList a .num{
  flex-shrink:0; width:26px; height:26px; border-radius:8px; background:var(--line); color:var(--ink-2);
  display:inline-flex; align-items:center; justify-content:center; font-size:.72rem; font-weight:800;
}
#navList a .ico{flex-shrink:0; width:20px; text-align:center; font-size:.95rem}
#navList a .done{flex-shrink:0; font-size:.82rem}

/* active = strong, unmissable */
#navList a.active{
  background:linear-gradient(90deg,var(--blue) 0%,var(--blue-m) 100%);
  color:#fff; border-left-color:var(--red); font-weight:700;
  box-shadow:0 3px 12px rgba(27,63,160,.35);
}
#navList a.active .num{background:rgba(255,255,255,.25); color:#fff}
#navList a.active .done{color:#fff}
#navList a.is-done .num{background:var(--green); color:#fff}
#navList a.is-done:not(.active){background:var(--green-l)}
#navList a.is-done:not(.active) .lbl{color:var(--ink)}
#navList a.current-part{font-weight:600; color:var(--ink)}

/* ---------------- CONTENT ---------------- */
.content{flex:1; min-width:0; padding:20px 26px 90px; max-width:1080px; margin:0 auto; width:100%}

.card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r-lg);
  box-shadow:var(--sh-1); padding:22px 24px; margin-bottom:18px;
}
.card > h2{margin:0; font-size:1.5rem; line-height:1.25; color:var(--ink)}
.card > h3{margin:20px 0 9px; font-size:1.06rem; color:var(--blue); display:flex; align-items:center; gap:8px}
h3 .h3count{font-size:.7rem; font-weight:700; color:var(--muted); background:var(--card-2); border:1px solid var(--line); padding:1px 8px; border-radius:99px}
.section-head{display:flex; justify-content:space-between; align-items:flex-start; gap:14px; flex-wrap:wrap; margin-bottom:10px}
.section-head .ur{color:var(--ink-2); font-size:.95rem}
.intro{margin:9px 0; color:var(--ink-2)}
.tip{background:var(--gold-l); border-left:4px solid var(--gold); padding:11px 15px; border-radius:var(--r-sm); margin:12px 0; font-size:.95rem}
.tip .lbl{font-weight:800; color:var(--gold); display:block; margin-bottom:3px; font-size:.82rem; letter-spacing:.03em; text-transform:uppercase}
.alert{background:var(--red-l); border-left:4px solid var(--red); padding:11px 15px; border-radius:var(--r-sm); margin:12px 0; font-size:.95rem}
.note{background:var(--blue-xl); border-left:4px solid var(--blue-m); padding:11px 15px; border-radius:var(--r-sm); margin:12px 0; font-size:.94rem}
.patterns{display:flex; flex-wrap:wrap; gap:7px; margin:10px 0}
.chip{display:inline-block; background:var(--blue-l); color:var(--blue); padding:3px 11px; border-radius:99px; font-weight:700; font-size:.83rem}
.chip.alt{background:var(--purple-l); color:var(--purple)}
.chip.warm{background:var(--gold-l); color:var(--gold)}
.chip.ok{background:var(--green-l); color:var(--green)}

/* lesson header strip */
.lesson-meta{display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:10px}
.pill{font-size:.72rem; font-weight:800; letter-spacing:.05em; text-transform:uppercase; padding:3px 10px; border-radius:99px; background:var(--blue-l); color:var(--blue)}
.pill.red{background:var(--red-l); color:var(--red)}
.pill.green{background:var(--green-l); color:var(--green)}
.pill.gold{background:var(--gold-l); color:var(--gold)}
.pill.dark{background:var(--ink); color:var(--card)}
.lesson-topics{display:flex; flex-wrap:wrap; gap:6px; margin:8px 0 2px}

/* ---------------- BUTTONS ---------------- */
.btn{
  display:inline-flex; align-items:center; gap:6px; border:none; border-radius:var(--r-sm);
  padding:8px 14px; font-weight:700; font-size:.88rem; cursor:pointer; font-family:inherit;
  transition:transform .06s, filter .15s;
}
.btn:hover{filter:brightness(1.06)}
.btn:active{transform:scale(.975)}
.btn.play{background:var(--blue); color:#fff}
.btn.slow{background:var(--blue-l); color:var(--blue)}
.btn.ghost{background:transparent; border:1px solid var(--line-2); color:var(--ink-2)}
.btn.ghost:hover{background:var(--card-2)}
.btn.primary{background:var(--red); color:#fff}
.btn.done-btn{background:var(--green); color:#fff}
.btn.green{background:var(--green); color:#fff}
.btn.tiny{padding:4px 10px; font-size:.77rem; border-radius:8px}
.btn.wide{width:100%; justify-content:center}
.btn-row{display:flex; gap:8px; flex-wrap:wrap; margin:11px 0; align-items:center}
.btn.mic{background:var(--card); border:2px solid var(--red); color:var(--red)}
.btn.mic.listening{background:var(--red); color:#fff; animation:pulse 1.1s infinite}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(217,43,64,.5)}100%{box-shadow:0 0 0 14px rgba(217,43,64,0)}}

/* ---------------- WORD CARDS ---------------- */
.words{display:grid; grid-template-columns:repeat(auto-fill,minmax(258px,1fr)); gap:12px; margin-top:10px}
.word{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  padding:13px 15px; display:flex; flex-direction:column; gap:5px; position:relative;
  transition:border-color .15s, box-shadow .15s;
}
.word:hover{border-color:var(--blue-m); box-shadow:var(--sh-2)}
.word .fr{font-size:1.3rem; font-weight:800; line-height:1.3; color:var(--ink)}
.word .fr .silent{color:var(--muted); text-decoration:line-through; text-decoration-color:var(--red); text-decoration-thickness:2px}
.word .fr .hl{color:var(--red); text-decoration:underline; text-decoration-color:var(--red); text-decoration-thickness:2px}
.word .en{color:var(--ink-2); font-size:.92rem}
.word .ur{font-size:1.02rem; text-align:right; color:var(--ink)}
.word .ru{font-size:.85rem; color:var(--muted); font-style:italic}
.word .trn{color:var(--purple); font-size:.95rem; font-weight:600}
.pr-row{display:flex; gap:6px; flex-wrap:wrap; margin-top:2px}
.pr{font-size:.78rem; color:var(--blue); font-family:var(--mono); background:var(--blue-l); padding:2px 8px; border-radius:6px; display:inline-block}
.pr.urdu{font-family:var(--urdu); direction:rtl; font-size:.9rem; background:var(--purple-l); color:var(--purple)}
/* pronunciation in the learner's own script (any language) */
.pr.nat-pr{font-size:.85rem; background:var(--purple-l); color:var(--purple);
  font-family:"Noto Sans","Noto Naskh Arabic","Noto Sans Arabic","Noto Sans Devanagari",
              "Noto Sans Bengali","Noto Sans Thai","Noto Sans CJK SC",system-ui,sans-serif;
  unicode-bidi:plaintext; text-align:start}
.pr.nat-pr:empty{display:none}   /* still loading, or no script available */
.word .note{font-size:.79rem; color:var(--gold); background:transparent; border:none; padding:0; margin:0}
.word .acts{display:flex; gap:6px; margin-top:auto; padding-top:8px}
.word.big .fr{font-size:2.1rem}

/* alphabet */
.alpha{display:grid; grid-template-columns:repeat(auto-fill,minmax(108px,1fr)); gap:10px}
.alpha .word{align-items:center; text-align:center; cursor:pointer; padding:11px 8px}
.alpha .word .fr{font-size:1.9rem}
.alpha .word .pr{align-self:center}

/* pairs */
.pair{display:grid; grid-template-columns:1fr auto 1fr; gap:12px; align-items:center; background:var(--card-2); border:1px dashed var(--line-2); border-radius:var(--r); padding:11px 14px; margin:9px 0}
.pair .vs{font-weight:800; color:var(--red); font-size:.85rem}
.pair .side{display:flex; flex-direction:column; gap:2px}
.pair .side .fr{font-size:1.2rem; font-weight:800; cursor:pointer}
.pair .side .fr:hover{color:var(--blue)}
.pair .side .mean{font-size:.83rem; color:var(--muted)}

/* sentences / examples */
.sent{border:1px solid var(--line); border-radius:var(--r); padding:13px 15px; margin:9px 0; background:var(--card)}
.sent:hover{border-color:var(--line-2)}
.sent .fr{font-size:1.18rem; font-weight:700; line-height:1.4}
.sent .row{display:flex; flex-wrap:wrap; gap:6px 14px; font-size:.92rem; color:var(--ink-2); margin-top:5px; align-items:center}
.sent .row .ur{color:var(--ink)}
.sent .row .ru{color:var(--muted); font-style:italic}
.ex-no{display:inline-flex; width:22px; height:22px; border-radius:50%; background:var(--blue-l); color:var(--blue); font-size:.72rem; font-weight:800; align-items:center; justify-content:center; margin-right:8px; vertical-align:2px}

/* dialogue */
.dlg{background:var(--card-2); border:1px solid var(--line); border-radius:var(--r); padding:6px 14px; margin:10px 0}
.dline{display:flex; gap:12px; padding:11px 0; border-bottom:1px dashed var(--line)}
.dline:last-child{border-bottom:none}
.dwho{flex-shrink:0; width:34px; height:34px; border-radius:50%; background:var(--blue); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:.85rem}
.dwho.b{background:var(--red)}
.dbody{flex:1; min-width:0}
.dbody .fr{font-size:1.1rem; font-weight:700}
.dbody .meta{font-size:.88rem; color:var(--ink-2); margin-top:3px; display:flex; flex-wrap:wrap; gap:5px 14px; align-items:center}

/* grammar tables */
.tbl-wrap{overflow-x:auto; margin:12px 0; border:1px solid var(--line); border-radius:var(--r)}
table.gt{border-collapse:collapse; width:100%; font-size:.9rem; background:var(--card)}
table.gt th{background:var(--blue-xl); color:var(--blue); text-align:left; padding:9px 12px; font-size:.78rem; text-transform:uppercase; letter-spacing:.05em; white-space:nowrap; border-bottom:1px solid var(--line)}
table.gt td{padding:9px 12px; border-bottom:1px solid var(--line); vertical-align:top}
table.gt tr:last-child td{border-bottom:none}
table.gt tr:hover td{background:var(--card-2)}
table.gt td:nth-child(2){font-weight:700}

/* the word and its play buttons share the top row */
.word .wtop{display:flex; align-items:center; justify-content:space-between; gap:10px}
.word .wtop .fr{flex:1 1 auto; min-width:0}
.word .wtop .acts{flex:0 0 auto; margin:0}
.word .wtop .acts .btn{white-space:nowrap}

/* ---- tighter vocabulary cards on a phone ----
   16 word cards per lesson; trimming each one keeps the first three sections
   open without the page running away from the reader. */
@media (max-width:760px){
  .words{gap:8px; margin-top:8px; grid-template-columns:1fr}
  .word{padding:10px 12px; gap:3px}

  /* One clear reading order: the French word, then your own language big,
     with English dimmed underneath. Before this every line shouted equally. */
  .word .fr{font-size:1.15rem; line-height:1.3; letter-spacing:-.01em}
  .word .nat{font-size:1rem; line-height:1.6; color:var(--ink); font-weight:600}
  .word .trn{font-size:1rem; line-height:1.6; color:var(--ink); font-weight:600}
  .word .ur{font-size:1rem; line-height:1.9; color:var(--ink); font-weight:600}
  .word .en{font-size:.83rem; line-height:1.35; color:var(--muted)}
  .word .ru{font-size:.76rem; line-height:1.35; color:var(--muted)}

  .pr{font-size:.72rem; padding:2px 7px}
  .pr.urdu{font-size:.86rem}
  .pr.nat-pr{font-size:.82rem}
  .word .note{font-size:.78rem; padding:6px 9px; line-height:1.45; margin-top:3px}

  .word .row{gap:6px; margin-top:4px}
  .word .row .btn{padding:7px 12px; font-size:.83rem; min-height:36px}
  /* labels off, icons on — the row stays one line whatever the word length */
  .word .wtop{align-items:flex-start}
  .word .wtop .acts{gap:6px}
  .word .wtop .acts .bl{display:none}
  .word .wtop .acts .btn{padding:8px 10px; min-width:38px; min-height:38px; font-size:.95rem}
}

/* ---- wide tables stack into labelled cards on a narrow screen ----
   table.gt is width:100%, so it never scrolled; it squeezed the last column
   down to one letter per line. 3+ column tables now become readable rows. */
@media (max-width:760px){
  .tbl-wrap.resp-wrap{overflow:visible; border:none; border-radius:0; margin:10px 0; background:transparent}
  table.gt.resp{background:transparent; font-size:.92rem}
  table.gt.resp thead{display:none}
  table.gt.resp tbody, table.gt.resp tr, table.gt.resp td{display:block; width:auto}
  table.gt.resp tr{background:var(--card); border:1px solid var(--line); border-radius:var(--r);
    padding:10px 13px; margin:0 0 10px}
  table.gt.resp tr:last-child{margin-bottom:0}
  table.gt.resp td{border:none; padding:3px 0; overflow-wrap:anywhere}
  table.gt.resp td + td{margin-top:5px}
  table.gt.resp td::before{content:attr(data-label); display:block; font-size:.65rem;
    text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:800; margin-bottom:1px}
  table.gt.resp tr:hover td{background:transparent}
  table.gt.resp td:nth-child(2){font-weight:700; color:var(--ink)}
  table.gt.resp .mono{color:var(--blue)}
}

/* a quiet line under the voice picker explaining what was found */
.voice-note{display:block; margin-top:5px; font-size:.74rem; line-height:1.5;
  color:var(--muted); font-weight:500}

/* audio / voice practice */
.voice-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:12px; margin-top:10px}
.vcard{border:1px solid var(--line); border-radius:var(--r); background:var(--card); padding:13px 15px}
.vcard .fr{font-size:1.15rem; font-weight:800}
.vcard .ln{font-size:.85rem; color:var(--ink-2); margin-top:5px; display:flex; gap:7px; flex-wrap:wrap; align-items:baseline}
.vcard .ln b{font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); min-width:78px; display:inline-block}
.slowtxt{font-family:var(--mono); color:var(--green); background:var(--green-l); padding:1px 7px; border-radius:6px}
.nattxt{font-family:var(--mono); color:var(--blue); background:var(--blue-l); padding:1px 7px; border-radius:6px}

/* quiz */
.quiz-q{font-size:1.06rem; margin:12px 0; font-weight:600}
.options{display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:10px; margin:11px 0}
.opt{
  padding:13px 15px; border:2px solid var(--line); border-radius:var(--r); background:var(--card);
  cursor:pointer; font-size:1rem; font-weight:600; text-align:left; color:var(--ink); font-family:inherit;
  transition:border-color .15s, background .15s;
}
.opt:hover{border-color:var(--blue-m); background:var(--blue-xl)}
.opt.correct{border-color:var(--green); background:var(--green-l); color:var(--green)}
.opt.wrong{border-color:var(--red); background:var(--red-l); color:var(--red)}
.opt:disabled{cursor:default}
.score{font-weight:800; color:var(--blue)}
.result{margin-top:9px; padding:11px 14px; border-radius:var(--r-sm); font-weight:600; font-size:.94rem; line-height:1.65}
.result.ok{background:var(--green-l); color:var(--green)}
.result.bad{background:var(--red-l); color:var(--red)}
.result.neutral{background:var(--blue-l); color:var(--blue)}
.heard{font-family:var(--mono); font-size:.95rem}
.why{display:block; margin-top:7px; font-size:.86rem; color:var(--ink-2); font-weight:500}

/* learner-language meaning line (shown under the English meaning) */
.nat{margin-top:5px; font-size:.97rem; font-weight:600; color:var(--purple); line-height:1.7}
.word .nat{font-size:1rem}
.sent .nat{font-weight:600}
.intro.nat{color:var(--purple); font-weight:500}
.note.nat{background:transparent; border-left:none; padding:0; margin-top:6px}
.why .nat{margin-top:6px; font-weight:600}
.goal .nat{margin-top:4px}
.ln.nat{margin-top:4px}
[dir="rtl"]{text-align:right}
.pr-row .pr.urdu{font-family:var(--urdu); direction:rtl}

/* blurred self-check answers */
.blurred{filter:blur(6px); cursor:pointer; user-select:none; transition:filter .18s}
.blurred:hover{filter:blur(4px)}
.blurred.done,.blurred:not(.blurred){filter:none}

/* answer key */
.key{display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:7px; margin:10px 0; font-family:var(--mono); font-size:.88rem}
.key span{background:var(--card-2); border:1px solid var(--line); border-radius:8px; padding:5px 9px}
.key span b{color:var(--blue)}

/* review test sections */
.testgrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:12px}
.qa{border:1px solid var(--line); border-radius:var(--r-sm); padding:11px 13px; background:var(--card-2)}
.qa .q{font-weight:600; font-size:.94rem}
.qa .a{margin-top:5px; font-size:.94rem; color:var(--green); font-weight:700}
.passage{background:var(--card-2); border:1px solid var(--line); border-left:4px solid var(--blue-m); border-radius:var(--r-sm); padding:14px 16px; margin:12px 0; line-height:1.85}
.passage .fr{font-size:1.02rem}

/* roadmap */
.part-card{border:1px solid var(--line); border-radius:var(--r-lg); background:var(--card); padding:18px 20px; margin-bottom:14px; box-shadow:var(--sh-1)}
.part-card h3{margin:0 0 4px; color:var(--blue); font-size:1.15rem}
.part-card .goal{color:var(--ink-2); font-size:.94rem; margin:6px 0 10px}
.part-card ul{margin:8px 0 12px; padding-left:20px}
.part-card li{margin:3px 0; font-size:.93rem}
.part-lessons{display:flex; flex-wrap:wrap; gap:6px; margin-top:10px}
.mini-lesson{
  display:inline-flex; align-items:center; gap:6px; padding:5px 11px; border-radius:99px; font-size:.82rem;
  background:var(--blue-xl); border:1px solid var(--line); color:var(--ink-2); font-weight:600; cursor:pointer;
}
.mini-lesson:hover{border-color:var(--blue-m); background:var(--blue-l); text-decoration:none}
.mini-lesson.is-done{background:var(--green-l); border-color:var(--green); color:var(--green)}

.syl-item{display:flex; gap:10px; align-items:flex-start; padding:7px 0; border-bottom:1px dashed var(--line); font-size:.93rem}
.syl-item:last-child{border-bottom:none}
.syl-box{flex-shrink:0; width:19px; height:19px; border-radius:6px; border:2px solid var(--line-2); margin-top:3px}
.syl-box.done{background:var(--green); border-color:var(--green); position:relative}
.syl-box.done::after{content:"✓"; position:absolute; inset:0; color:#fff; font-size:.72rem; display:flex; align-items:center; justify-content:center; font-weight:900}

.stats{display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; margin:14px 0}
.stat{background:var(--card-2); border:1px solid var(--line); border-radius:var(--r); padding:13px; text-align:center}
.stat .n{font-size:1.7rem; font-weight:800; color:var(--blue); line-height:1.1}
.stat .l{font-size:.76rem; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-top:3px}

/* search page */
.search{width:100%; padding:12px 15px; border-radius:var(--r); border:1px solid var(--line); font-size:1rem; background:var(--card); color:var(--ink); outline:none; font-family:inherit}
.search:focus{border-color:var(--blue-m); box-shadow:0 0 0 3px var(--blue-l)}

/* modal */
.modal{position:fixed; inset:0; background:rgba(9,14,28,.6); z-index:80; display:flex; align-items:center; justify-content:center; padding:18px; backdrop-filter:blur(3px)}
.modal-box{background:var(--card); border-radius:var(--r-lg); box-shadow:var(--sh-3); width:100%; max-width:640px; max-height:88vh; display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--line)}
.modal-head{padding:16px 20px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:12px}
.modal-head h3{margin:0; font-size:1.1rem; color:var(--ink); flex:1}
.modal-body{padding:14px 20px 20px; overflow-y:auto}
.modal-body .search{margin-bottom:12px}
.lang-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:8px}
.lang-opt{padding:10px 12px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--card); cursor:pointer; text-align:left; font-family:inherit; color:var(--ink); font-size:.9rem}
.lang-opt:hover{border-color:var(--blue-m); background:var(--blue-xl)}
.lang-opt.sel{border-color:var(--blue); background:var(--blue-l); font-weight:700}
.lang-opt .nat{display:block; font-size:.8rem; color:var(--muted); margin-top:2px}
.x-btn{margin-left:auto; background:var(--card-2); border:1px solid var(--line); border-radius:9px; width:32px; height:32px; cursor:pointer; font-size:1rem; color:var(--ink)}
.x-btn:hover{background:var(--red-l); color:var(--red)}

/* translate progress bar */
.trbar{position:fixed; left:50%; bottom:22px; transform:translateX(-50%); background:var(--ink); color:var(--card); padding:11px 20px; border-radius:999px; font-size:.88rem; z-index:90; box-shadow:var(--sh-3); display:flex; align-items:center; gap:12px; max-width:92vw}
.trbar .sp{width:15px; height:15px; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite; flex-shrink:0}
@keyframes spin{to{transform:rotate(360deg)}}
.trbar .pbar{width:120px; height:6px; background:rgba(255,255,255,.25); border-radius:99px; overflow:hidden}
.trbar .pbar i{display:block; height:100%; background:var(--green); width:0}

/* toast */
.toast{position:fixed; left:50%; bottom:22px; transform:translateX(-50%); background:var(--ink); color:var(--card); padding:11px 20px; border-radius:999px; font-size:.88rem; z-index:95; box-shadow:var(--sh-3)}

/* footer */
footer.foot{margin-top:34px; padding-top:16px; border-top:1px solid var(--line); color:var(--muted); font-size:.8rem; text-align:center; line-height:1.8}

/* nav bottom pager */
.pager{display:flex; justify-content:space-between; gap:12px; margin-top:20px; flex-wrap:wrap}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width:1100px){
  .gsearch{max-width:280px}
}
@media (max-width:900px){
  #menuBtn{display:inline-block}
  .brand-sub{display:none}
  .sidebar{
    position:fixed; left:0; top:var(--nav-h); height:calc(100vh - var(--nav-h)); z-index:35;
    transform:translateX(-102%); transition:transform .25s ease; box-shadow:0 0 40px rgba(0,0,0,.3);
  }
  .sidebar.open{transform:translateX(0)}
  .content{padding:14px 14px 90px}
  .card{padding:17px 16px; border-radius:var(--r)}
  .pair{grid-template-columns:1fr; gap:6px}
  .pair .vs{text-align:center}
  /* Two rows on a phone instead of three: row 1 = menu, brand, language,
     settings, theme — row 2 = search, convert. display:contents lets the
     Convert button leave .hbtns and join row 2. */
  .hbtns{display:contents}
  .bar1{flex-wrap:wrap; padding:8px 12px 6px; gap:8px}
  #menuBtn{order:1}
  .brand{order:2; min-width:0}
  #langBtn{order:3}
  #settingsBtn{order:4}
  #themeBtn{order:5}
  .gsearch{order:6; flex:1 1 auto; max-width:none; margin:0; min-width:130px}
  #convertBtn{order:7}
  .bar1 .gsearch input{padding:7px 14px 7px 35px; font-size:.89rem}
  .hbtn{min-height:40px; min-width:40px; padding:8px 12px; justify-content:center}
  .settings{gap:12px}
  .settings select,.settings input[type=range]{min-width:130px}
}
@media (max-width:560px){
  body{font-size:15.5px}
  table.gt th, table.gt td{padding:8px 9px; font-size:.85rem}
  table.gt td{overflow-wrap:anywhere}
  .mist-grid{grid-template-columns:1fr; gap:8px}
  .mist{padding:11px 12px}
  .words{grid-template-columns:1fr}
  .options{grid-template-columns:1fr}
  .brand-title{font-size:.82rem}
  .bar1{gap:7px; padding:7px 11px 5px}
  .hbtn .hbtn-txt{display:none}
  .hbtn{padding:9px 12px; min-height:42px; min-width:42px}
}

/* print */
@media print{
  .topbar,.sidebar,.btn,.acts,.toast,.trbar{display:none !important}
  .content{padding:0; max-width:none}
  .card{box-shadow:none; border:none; page-break-inside:avoid}
}

/* lesson section letters A–N */
.sec-no{
  display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
  width:25px; height:25px; border-radius:8px; background:var(--blue); color:#fff;
  font-size:.76rem; font-weight:900; letter-spacing:0; box-shadow:0 2px 6px rgba(27,63,160,.28);
}
[data-theme="dark"] .sec-no{color:#0d1220}
h3:has(.sec-no){gap:10px}

/* generic warning strip (kept for compatibility) */
.warning{font-size:.9rem}
key{color:var(--blue);font-weight:700}

/* translated line added under English instructions / review questions */
.q .nat{font-weight:500; font-size:.93rem; margin-top:5px}
.intro + .nat{margin-top:-4px}
ul .nat, ol .nat{font-size:.94rem; font-weight:500; margin-top:3px}
li .nat{list-style:none}
small.nat{font-size:.85rem}

/* =====================================================================
   LIVE-SITE COMPONENTS
   ===================================================================== */

/* skip link for keyboard users */
.skip-link{
  position:absolute; left:-9999px; top:0; z-index:100; background:var(--blue); color:#fff;
  padding:10px 18px; border-radius:0 0 10px 0; font-weight:700;
}
.skip-link:focus{left:0}

/* visible focus everywhere (accessibility) */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,
textarea:focus-visible,[tabindex]:focus-visible{
  outline:3px solid var(--blue-m); outline-offset:2px; border-radius:6px;
}

/* back to top */
.to-top{
  position:fixed; right:20px; bottom:22px; z-index:45; width:46px; height:46px; border-radius:50%;
  border:none; background:var(--blue); color:#fff; font-size:1.25rem; font-weight:800; cursor:pointer;
  box-shadow:var(--sh-3); transition:transform .15s, background .15s;
}
.to-top:hover{transform:translateY(-3px); background:var(--blue-m)}

/* share row */
.share-row{display:flex; flex-wrap:wrap; gap:9px; margin:12px 0}
.share-btn{
  display:inline-flex; align-items:center; gap:7px; padding:8px 14px; border-radius:999px;
  background:var(--card); border:1.5px solid var(--line-2); color:var(--ink); font-size:.86rem;
  font-weight:700; cursor:pointer; font-family:inherit; text-decoration:none; transition:all .15s;
}
.share-btn:hover{border-color:var(--sc); color:var(--sc); transform:translateY(-1px); text-decoration:none}
.share-btn span:first-child{font-size:1rem}

/* rating */
.rate-box{
  background:var(--gold-l); border:1px solid var(--line); border-left:4px solid var(--gold);
  border-radius:var(--r); padding:12px 15px; margin-top:14px;
}
.rate-label{font-weight:700; font-size:.93rem; margin-bottom:7px}
.stars{display:flex; gap:5px}
.star{
  background:none; border:none; font-size:1.9rem; line-height:1; cursor:pointer; color:var(--line-2);
  padding:0 2px; transition:transform .12s, color .12s; font-family:inherit;
}
.star:hover{transform:scale(1.18)}
.star.on{color:var(--gold)}
.rate-note{font-size:.82rem; color:var(--muted); margin-top:6px}

/* feedback form */
.fb-lbl{display:block; font-weight:700; font-size:.88rem; margin:13px 0 5px}
.fb-lbl .small{font-weight:500}
textarea.search{resize:vertical; line-height:1.6; font-family:inherit}
#fbBody .result{margin-top:12px}

/* footer */
footer.foot{
  margin-top:36px; padding:26px 4px 40px; border-top:1px solid var(--line);
  color:var(--muted); font-size:.85rem;
}
.foot-grid{display:grid; grid-template-columns:1.6fr 1fr 1fr 1fr; gap:22px; margin-bottom:20px}
.foot-brand{display:flex; align-items:center; gap:8px; color:var(--ink); margin-bottom:7px; font-size:.98rem}
.foot-h{font-weight:800; color:var(--ink); text-transform:uppercase; letter-spacing:.06em; font-size:.7rem; margin-bottom:9px}
footer.foot a{display:block; color:var(--muted); padding:3px 0; text-decoration:none}
footer.foot a:hover{color:var(--blue); text-decoration:underline}
.foot-bottom{
  border-top:1px solid var(--line); padding-top:14px; display:flex; flex-direction:column; gap:6px;
  text-align:center; align-items:center;
}
@media (max-width:820px){
  .foot-grid{grid-template-columns:1fr 1fr; gap:16px}
}
@media (max-width:520px){
  .foot-grid{grid-template-columns:1fr}
  .star{font-size:1.7rem}
  .share-btn{padding:7px 11px; font-size:.8rem}
}

/* respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce){
  *{animation-duration:.001ms !important; transition-duration:.001ms !important; scroll-behavior:auto !important}
}

/* =====================================================================
   FLASHCARDS + SPACED REPETITION
   ===================================================================== */
.srs-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:10px;margin:14px 0}
.srs-stat{background:var(--blue-xl);border:1px solid var(--line);border-radius:12px;padding:12px 8px;text-align:center}
.srs-ico{font-size:1.15rem;line-height:1}
.srs-val{font-size:1.55rem;font-weight:800;color:var(--blue);line-height:1.25}
.srs-key{font-size:.72rem;color:var(--muted);text-transform:uppercase;letter-spacing:.4px;font-weight:600}
[data-theme="dark"] .srs-stat{background:#161c2e}

.srs-set{display:flex;gap:14px;flex-wrap:wrap;margin:10px 0}
.srs-set label{flex:1 1 240px}

.flash-cta{margin-top:14px;padding-top:14px;border-top:1px dashed var(--line-2);align-items:center}

.flash-wrap{max-width:760px;margin:0 auto}
.flash-bar{height:7px;background:var(--line);border-radius:99px;overflow:hidden;margin-bottom:12px}
.flash-bar-fill{height:100%;background:linear-gradient(90deg,var(--blue-m),var(--green));border-radius:99px;transition:width .25s}
.flash-meta{display:flex;gap:12px;flex-wrap:wrap;justify-content:space-between;font-size:.78rem;color:var(--muted);font-weight:600;margin-bottom:10px}
.flash-tally{margin-left:auto}

.flash-card{
  background:linear-gradient(160deg,#fff,var(--blue-xl));
  border:2px solid var(--line-2);border-radius:18px;padding:38px 22px;text-align:center;
  cursor:pointer;transition:transform .12s,box-shadow .12s;box-shadow:0 6px 22px rgba(27,63,160,.08);
}
.flash-card:hover{transform:translateY(-2px);box-shadow:0 10px 28px rgba(27,63,160,.15)}
.flash-card.flipped{border-color:var(--blue-m)}
[data-theme="dark"] .flash-card{background:linear-gradient(160deg,#1a2135,#141a2b)}
.flash-fr{font-size:2rem;font-weight:800;color:var(--ink);line-height:1.3;margin-bottom:8px}
.flash-play{margin-top:12px;display:flex;gap:8px;justify-content:center}
.flash-hint{margin-top:14px;font-size:.8rem;color:var(--muted);font-weight:600}
.flash-answer{
  margin-top:14px;padding:16px 18px;background:var(--green-l);border:1px solid #bfe3cc;border-radius:14px;
  text-align:center;animation:fadeUp .18s ease-out;
}
[data-theme="dark"] .flash-answer{background:#12261a;border-color:#205034}
.flash-answer .en{font-size:1.18rem;font-weight:700;color:var(--ink)}
.flash-actions{margin-top:18px;justify-content:center;gap:12px}
.flash-actions .btn{min-width:170px}
.flash-keys{margin-top:14px;text-align:center}

.flash-done{text-align:center;padding:26px 12px}
.flash-done-ico{font-size:2.6rem;line-height:1;margin-bottom:8px}
.flash-done h3{margin:0 0 8px}

@media (max-width:640px){
  .flash-fr{font-size:1.55rem}
  .flash-card{padding:26px 14px}
  .flash-actions .btn{min-width:0;flex:1 1 44%}
}

@keyframes fadeUp{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* =====================================================================
   COLLAPSIBLE LESSON SECTIONS
   A lesson is roughly 48 phone screens of scrolling. Sections fold away so
   the page opens as a short, scannable list; the chips jump straight to one.
   ===================================================================== */
.acc{scroll-margin-top:calc(var(--nav-h) + 62px); overflow:hidden}
/* a folded section should be a slim, scannable row */
.acc:not(.open){padding-top:10px; padding-bottom:10px}
.acc:not(.open){height:60px; max-height:60px}
/* a folded section must LOOK pressable, not like plain text.
   Explicit colours here (not vars): a var reference inside the shift-cascade
   left this rule resolving to transparent in testing. */
.acc-head.foldbg{background:#f2f6ff; border:1px solid #e2e7f2; box-shadow:0 1px 2px rgba(19,26,43,.05)}
.acc-head.foldbg:hover{background:#e8effd; border-color:#2f5fd0}
.acc-head.foldbg .acc-chev{background:#1b3fa0; color:#fff}
[data-theme="dark"] .acc-head.foldbg{background:#18213a; border-color:#28324a}
[data-theme="dark"] .acc-head.foldbg:hover{background:#1d2a4d; border-color:#5c8bfa}
.acc:not(.open) .acc-head{margin-top:-10px; margin-bottom:-10px; height:40px; min-height:40px;
  max-height:40px; flex-wrap:nowrap; overflow:hidden}
/* folded rows are one tidy line each, whatever the title length */
.acc:not(.open) .acc-head > span:not(.sec-no):not(.h3count):not(.acc-chev){
  flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block}
.acc:not(.open) .acc-head .sec-no,
.acc:not(.open) .acc-head .h3count,
.acc:not(.open) .acc-head .acc-chev{flex:0 0 auto; overflow:visible}
.acc-head{cursor:pointer; user-select:none; -webkit-tap-highlight-color:transparent;
  display:flex; align-items:center; gap:10px; border-radius:12px;
  margin:-9px -11px -9px -11px; padding:9px 11px; transition:background .15s ease}
.acc-head:hover{background:var(--blue-xl)}
.acc-head:focus-visible{outline:2px solid var(--blue-m); outline-offset:2px}
.acc-chev{flex:0 0 auto; margin-left:auto; width:27px; height:27px; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center; background:var(--blue-l);
  color:var(--blue); font-size:15px; line-height:1; transition:transform .22s ease, background .15s ease}
.acc-chev::before{content:"\25be"}
.acc.open .acc-chev{transform:rotate(180deg); background:var(--blue-m); color:#fff}
.acc-body{display:none}
.acc.open .acc-body{display:block; animation:accIn .22s ease both}
@keyframes accIn{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}

/* the start page leads with its main action */
.hero-cta{display:flex; flex-wrap:wrap; gap:10px; margin:16px 0 18px}
.btn.big{padding:14px 22px; font-size:1rem; font-weight:800; min-height:50px;
  display:inline-flex; align-items:center; justify-content:center; gap:8px}
.btn.green.big{box-shadow:0 8px 22px rgba(20,140,90,.28)}
@media (max-width:760px){
  .hero-cta{gap:9px; margin:14px 0 16px}
  .btn.big{flex:1 1 auto; padding:14px 16px; font-size:.95rem; min-height:50px}
  .btn.ghost.big{flex:0 1 auto}
}

/* sub-sections folded inside one long card (home page) */
.sub{display:block}
.sub-head{font-size:1.02rem; margin:2px -10px; padding:8px 10px; border-radius:11px}
.sub:not(.open) .sub-head{margin-bottom:2px}
.sub-body{display:none}
.sub.open .sub-body{display:block; animation:accIn .22s ease both}
.sub .acc-chev{width:24px; height:24px; font-size:13px}

/* the sticky row of section chips */
.acc-bar{position:sticky; top:var(--nav-h); z-index:30; display:flex; align-items:center; gap:7px;
  overflow-x:auto; padding:10px 2px; margin:0 0 14px;
  background:linear-gradient(var(--bg) 78%, rgba(244,246,251,0)); border-bottom:1px solid var(--line);
  scrollbar-width:none; -ms-overflow-style:none; -webkit-overflow-scrolling:touch}
.acc-bar::-webkit-scrollbar{display:none}
.acc-chip{flex:0 0 auto; border:1px solid var(--line-2); background:var(--card); color:var(--ink-2);
  border-radius:999px; padding:9px 15px; min-height:38px; font-size:.76rem; font-weight:700; white-space:nowrap;
  cursor:pointer; transition:transform .12s ease, border-color .15s ease, color .15s ease}
.acc-chip:hover{border-color:var(--blue-m); color:var(--blue)}
.acc-chip:active{transform:scale(.95)}
.acc-chip.all{border-color:var(--blue); background:var(--blue-l); color:var(--blue); font-weight:800}
.acc-chip.on{border-color:var(--blue-m); background:var(--blue-l); color:var(--blue)}
.acc-chip.on::after{content:"\25cf"; margin-left:6px; font-size:.6rem; vertical-align:middle}

.acc-hint{margin:-8px 0 12px; font-size:.78rem; color:var(--muted); line-height:1.5;
  display:flex; align-items:center; gap:7px}
.acc-hint::before{content:"\1F446"; font-size:.95rem; flex:0 0 auto}
@media (min-width:761px){.acc-hint{display:none}}

/* the line that separates the open part from the folded part */
.acc-more{position:relative; margin:16px 0 10px; text-align:center; line-height:1.6}
.acc-more::before{content:""; position:absolute; left:0; right:0; top:50%; height:1px; background:var(--line-2)}
.acc-more span{position:relative; display:inline-block; background:var(--bg); padding:0 12px;
  font-size:.75rem; font-weight:700; color:var(--muted)}
.acc-more span span{display:inline; background:none; padding:0}

/* a small floating shortcut back to the chip row */
.acc-jump{position:fixed; left:14px; bottom:16px; z-index:44; border:none; cursor:pointer;
  background:var(--blue); color:#fff; border-radius:999px; padding:12px 17px;
  font-size:.82rem; font-weight:800; box-shadow:0 10px 26px rgba(27,63,160,.38);
  opacity:0; visibility:hidden; transform:translateY(10px);
  transition:opacity .2s ease, transform .2s ease, visibility .2s}
.acc-jump.show{opacity:1; visibility:visible; transform:none}
.acc-jump:active{transform:translateY(1px)}

@media (max-width:760px){
  .acc-head{margin:-7px -6px; padding:7px 6px}
  .acc-chip{font-size:.73rem; padding:9px 14px; min-height:40px}
  .acc-bar{top:var(--nav-h)}
}

/* =====================================================================
   STOP BUTTON — the voice must always be stoppable
   ===================================================================== */
.btn.stop{border:1.5px solid var(--line-2); background:transparent; color:var(--ink-2); font-weight:700}
.btn.stop:hover{border-color:var(--red); color:var(--red); background:var(--red-l)}
.btn.stop:active{transform:translateY(1px)}
.btn.is-playing{background:var(--red) !important; color:#fff !important; border-color:var(--red) !important;
  animation:playingPulse 1.6s ease-in-out infinite}
@keyframes playingPulse{0%,100%{box-shadow:0 0 0 0 rgba(200,40,60,.45)}50%{box-shadow:0 0 0 7px rgba(200,40,60,0)}}

/* =====================================================================
   COMMON MISTAKES — cards, not a table
   A three-column table cannot be read on a phone: the "why" column gets
   squeezed to a few letters. These stack into one clean card per mistake.
   ===================================================================== */
.mist-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(270px,1fr)); gap:10px; margin:12px 0}
.mist{background:var(--card-2); border:1px solid var(--line); border-radius:var(--r); padding:12px 14px; min-width:0}
.mist-row{display:flex; gap:9px; align-items:flex-start}
.mist-row + .mist-row{margin-top:5px}
.mist-ico{flex:0 0 auto; line-height:1.5; font-size:.9rem}
.mist-wrong{color:var(--red); text-decoration:line-through; text-decoration-thickness:1px; overflow-wrap:anywhere}
.mist-right{color:var(--green); font-weight:700; overflow-wrap:anywhere}
.mist-why{margin-top:9px; padding-top:9px; border-top:1px dashed var(--line-2); font-size:.86rem; color:var(--ink-2); overflow-wrap:anywhere}
.mist-why b{color:var(--blue); font-weight:700}
.mist-why .nat{margin-top:4px; font-size:.86rem}

/* =====================================================================
   MOBILE SAFETY NET
   Nothing may push the page wider than the screen.
   ===================================================================== */
html,body{overflow-x:hidden; max-width:100%}
.content,.card,.sidebar,.topbar{min-width:0}
img,video,svg,table,pre,textarea{max-width:100%}
.share-link,.share-link .mono{overflow-wrap:anywhere; word-break:break-all}
.passage,.voice-script,pre{overflow-x:auto; white-space:pre-wrap; overflow-wrap:anywhere}
.tbl-wrap{max-width:100%}

/* long words in any language must not break the layout */
.word .fr,.sent .fr,.flash-fr,.st-fr{overflow-wrap:anywhere}

/* =====================================================================
   TOUCH TARGETS — Apple recommends 44px, Google 48px
   ===================================================================== */
@media (max-width:900px){
  #menuBtn{min-width:44px; min-height:44px; font-size:1.15rem}
  #navList a, .sidebar a{min-height:44px}
  .btn{min-height:44px}
  .btn.tiny{min-height:38px}
  .flash-actions .btn{min-height:52px; font-size:1rem}
  .flash-card{padding:30px 16px}
  .play, .mic, .icon-btn, .play-btn{min-width:42px; min-height:42px}
  .star{min-width:44px; min-height:44px; font-size:1.6rem}
  .share-btn{min-height:42px}
  .mcq-opt, .opt{min-height:44px}
  .gs-item{padding-top:11px; padding-bottom:11px}
}
