/* Layout idea: one narrow phone column; sticky two-row header (name and tools, then sections); fidel set large in a serif, everything else quiet. */
:root{
  /* Colours: Rob's "calm cool summer" palette (Palette 1): dusk indigo #413C58, sea glass #A3C4BC,
     sage #BFD7B5, pale lime #E7EFC5 and sand #F2DDA4. Indigo leads (header, buttons); sea glass and
     sage make the soft fills; sand is the one warm highlight. Text colours are deepened versions of the
     palette so they pass WCAG AA. */
  --bg:#f5f8f2; --surface:#ffffff; --ink:#26223a; --muted:#57536b; --line:#d9e3dd;
  --accent:#413c58; --accent-ink:#ffffff; --tint:#e4eeea; --gold:#2f6658;
  --good:#3b6b3d; --good-bg:#e6f0df; --bad:#a3443a; --bad-bg:#f8e7e2;
  --sun:#f2dda4; --sea:#a3c4bc; --sage:#bfd7b5; --lime:#e7efc5; --hero:#eef4d9; --pg-k:#a3c4bc; --pg-l:#f2dda4;
  --head-bg:#413c58; --head-gold:#f2dda4; --head-gold-ink:#2b2740; --head-ink:#ffffff; --head-soft:rgba(255,255,255,.13); --head-muted:rgba(255,255,255,.9); --tab-on:#ffffff; --tab-on-ink:#26223a;
  --sun-ink:#4a3a12; --sun-line:#c9a64e; --bad-ink:#ffffff; --head-track:rgba(255,255,255,.28); --head-knob:#ffffff; --theme:#413c58;
  --f-fidel:"Noto Serif Ethiopic","Noto Sans Ethiopic","Nyala","Kefa",serif;
  --f-fidel-sans:"Noto Sans Ethiopic","Nyala","Kefa",sans-serif;
  --f-body:"Figtree",system-ui,-apple-system,"Segoe UI",sans-serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --bg:#1a1824; --surface:#23212f; --ink:#eceee6; --muted:#aeabc0; --line:#353247;
    --accent:#a3c4bc; --accent-ink:#1a1824; --tint:#2b2a3b; --gold:#bfd7b5;
    --good:#a7d39c; --good-bg:#1f3021; --bad:#ef9a8e; --bad-bg:#3b211d;
    --sun:#f2dda4; --sea:#a3c4bc; --sage:#bfd7b5; --lime:#e7efc5; --hero:#2b2a3b; --pg-k:#6f8f87; --pg-l:#b9a46e;
    --head-bg:#2c2840; --head-ink:#eceee6; --head-soft:rgba(255,255,255,.08); --head-muted:rgba(236,238,230,.8); --tab-on:#a3c4bc; --tab-on-ink:#1a1824;
   --sun-ink:#4a3a12; --sun-line:#c9a64e; --bad-ink:#1a1824; --head-track:rgba(255,255,255,.28); --head-knob:#ffffff; --theme:#2c2840;
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#1a1824; --surface:#23212f; --ink:#eceee6; --muted:#aeabc0; --line:#353247;
  --accent:#a3c4bc; --accent-ink:#1a1824; --tint:#2b2a3b; --gold:#bfd7b5;
  --good:#a7d39c; --good-bg:#1f3021; --bad:#ef9a8e; --bad-bg:#3b211d;
  --sun:#f2dda4; --sea:#a3c4bc; --sage:#bfd7b5; --lime:#e7efc5; --hero:#2b2a3b; --pg-k:#6f8f87; --pg-l:#b9a46e;
  --head-bg:#2c2840; --head-ink:#eceee6; --head-soft:rgba(255,255,255,.08); --head-muted:rgba(236,238,230,.8); --tab-on:#a3c4bc; --tab-on-ink:#1a1824;
   --sun-ink:#4a3a12; --sun-line:#c9a64e; --bad-ink:#1a1824; --head-track:rgba(255,255,255,.28); --head-knob:#ffffff; --theme:#2c2840;
}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:16px;line-height:1.45;-webkit-text-size-adjust:100%}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none;-webkit-tap-highlight-color:transparent}
button:focus-visible,input:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.wrap{max-width:560px;margin:0 auto;padding:0 16px 48px}
.chips{display:flex;gap:8px;overflow-x:auto;padding:14px 0 4px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;padding:7px 13px;border-radius:999px;border:1px solid var(--line);background:var(--surface);font-size:.9rem;font-weight:500;white-space:nowrap}
.chip[aria-selected="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.chip .am{font-family:var(--f-fidel-sans);margin-right:5px}
h2{font-size:1.15rem;margin:20px 0 4px;text-wrap:balance}
h3{font-size:.8rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:22px 0 8px;font-weight:600}
h3 small{text-transform:none;letter-spacing:0;font-weight:400;font-size:.85rem}
p{margin:6px 0;max-width:65ch;text-wrap:pretty}
h1,h2,h3{text-wrap:balance}
small{text-wrap:pretty}
.lead{color:var(--muted);font-size:.95rem}
h3.lvl{font-size:.95rem;color:var(--ink);margin:26px 0 4px}
h3.lvl small{color:var(--muted)}
.lvlabout{color:var(--muted);font-size:.88rem;margin:0 0 10px}
.lvltag{margin:0 0 -6px;font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:600}
.am{font-family:var(--f-fidel)}
.rom{color:var(--gold);font-size:.85rem;font-style:italic}
body.norom .rom{display:none}
/* word by word (js/gloss.js): each Amharic word with its meaning under it, in Amharic order */
.glbtn{display:inline-flex;align-items:center;gap:7px;flex:none;font-size:.82rem;font-weight:600;color:var(--ink);padding:5px 10px 5px 6px;border-radius:999px;border:1px solid var(--line);background:var(--surface);white-space:nowrap}
.glbtn i{width:28px;height:16px;border-radius:8px;background:var(--line);position:relative;display:inline-block;transition:background .15s}
.glbtn i::after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:var(--surface);transition:left .15s}
.glbtn[aria-pressed="true"]{border-color:var(--accent)}
.glbtn[aria-pressed="true"] i{background:var(--accent)}
.glbtn[aria-pressed="true"] i::after{left:14px}
.glbar{display:flex;align-items:center;justify-content:space-between;gap:8px 12px;flex-wrap:wrap}
.glbar h3{margin-bottom:0}
.dtog{display:inline-flex;align-items:center;gap:12px;flex-wrap:wrap}
.gloss{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px;grid-column:1 / -1}
.gw{display:inline-flex;flex-direction:column;align-items:flex-start;padding:3px 8px 4px;border-radius:8px;background:var(--tint);max-width:100%}
.gw .am{font-family:var(--f-fidel-sans);font-size:1.02rem;line-height:1.3;display:block}
.gw .rom{font-size:.72rem;line-height:1.2}
.gw .ge{font-size:.8rem;line-height:1.25;color:var(--ink);font-weight:500}
.gw .ge.unsure{text-decoration:underline dotted;text-underline-offset:3px}
.row .form .gw .am,.row .gw .am{font-size:1.02rem}
.glq{display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-top:10px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.pcard{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:1px}
.pcard .am{font-size:1.6rem;line-height:1.3}
.pcard .en{font-size:.9rem;font-weight:500}
.tbl{background:var(--surface);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.row{display:grid;grid-template-columns:4.6rem 1fr auto;gap:10px;align-items:center;padding:10px 12px;border-top:1px solid var(--line)}
.row:first-child{border-top:0}
.row .who{font-family:var(--f-fidel-sans);color:var(--muted);font-size:.95rem}
.row .form .am{font-size:1.3rem;line-height:1.3;display:block}
.row .en{font-size:.85rem;color:var(--muted);text-align:right}
.vrow{grid-template-columns:1fr auto}
.vtbl .row{grid-template-columns:4.6rem minmax(0,1fr) minmax(0,1.15fr)}
.vtbl .row .en{color:var(--ink);font-size:.9rem;text-wrap:pretty}
.ptag{display:inline-block;font-size:.68rem;font-weight:700;line-height:1;padding:2px 5px;border-radius:5px;background:var(--tint);color:var(--muted);vertical-align:1px}
.vrow .en{color:var(--ink);font-weight:500;font-size:.95rem;max-width:11rem}
.tip{background:var(--tint);border-left:3px solid var(--accent);border-radius:0 10px 10px 0;padding:10px 12px;font-size:.9rem;margin-top:12px}
.tip .am,.note .am{font-family:var(--f-fidel-sans);font-size:1.08em}
.note{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin-top:10px}
.note h4{margin:0 0 4px;font-size:1rem}
.note p{font-size:.94rem}
.note .rom{font-size:.82rem}
.bar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;justify-content:space-between;margin:14px 0 10px}
.mini{display:inline-grid;grid-auto-flow:column;background:var(--tint);border-radius:9px;padding:3px;gap:3px}
.mini button{padding:6px 12px;border-radius:7px;font-size:.88rem;font-weight:600;color:var(--muted)}
.mini button[aria-selected="true"]{background:var(--surface);color:var(--ink)}
.flash{background:var(--surface);border:1px solid var(--line);border-radius:16px;min-height:200px;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:20px;text-align:center}
.flash .am{font-size:2.4rem;line-height:1.25}
.flash .en{font-size:1.2rem;font-weight:600}
.flash .hint{font-size:.8rem;color:var(--muted);margin-top:8px}
.btns{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin-top:10px}
.btn{padding:12px;border-radius:10px;border:1px solid var(--line);background:var(--surface);font-weight:600;text-align:center}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.wide{width:100%}
.count{font-size:.85rem;color:var(--muted);font-variant-numeric:tabular-nums}
.topic{display:grid;grid-template-columns:1fr auto;gap:2px 12px;align-items:center;width:100%;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px 14px}
.topic b{font-size:1rem}
.topic small{color:var(--muted);grid-column:1}
.topic .best{grid-row:1 / span 2;grid-column:2;font-size:.78rem;color:var(--muted);text-align:right;font-variant-numeric:tabular-nums}
.topic .best strong{display:block;font-size:1.1rem;color:var(--accent)}
.topic .best.untried{justify-self:end;background:var(--sun);color:var(--sun-ink);font-weight:600;border-radius:999px;padding:3px 9px;white-space:nowrap}
.topic[disabled]{opacity:.55;cursor:default}
.lnum{display:inline-block;min-width:1.9em;color:var(--accent);font-variant-numeric:tabular-nums}
.stack{display:flex;flex-direction:column;gap:8px}
.prog{height:6px;background:var(--line);border-radius:3px;overflow:hidden;margin:18px 0 6px}
.prog i{display:block;height:100%;background:var(--accent);transition:width .2s}
.q{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:18px 16px;text-align:center;margin:12px 0}
.q .kind{font-size:.78rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:600}
.q .big{font-size:1.45rem;font-weight:600;margin-top:6px;line-height:1.3}
.q .big.am{font-size:2.2rem;font-weight:500}
.q .sub{color:var(--muted);margin-top:4px}
.opt{width:100%;text-align:left;background:var(--surface);border:1.5px solid var(--line);border-radius:12px;padding:12px 14px;display:flex;flex-direction:column}
.opt .am{font-size:1.35rem;line-height:1.3}
.opt.right{border-color:var(--good);background:var(--good-bg)}
.opt.wrong{border-color:var(--bad);background:var(--bad-bg)}
.opt[disabled]{cursor:default}
.fb{font-weight:600;margin:12px 0 0}
.fb.good{color:var(--good)} .fb.bad{color:var(--bad)}
.fb .am{font-size:1.4rem;font-weight:500}
.score{text-align:center;padding:26px 16px}
.score .n{font-size:3rem;font-weight:700;color:var(--accent);font-variant-numeric:tabular-nums;line-height:1.1}
.miss{padding:10px 12px;border-top:1px solid var(--line);font-size:.92rem}
.miss:first-child{border-top:0}
.miss .am{font-size:1.15rem}
.miss s{color:var(--bad)}
.back{color:var(--accent);font-weight:600;padding:14px 0 0;font-size:.95rem}
.sel{font:inherit;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:8px 10px;max-width:100%}
.vgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:6px;max-height:232px;overflow-y:auto;padding:2px}
.vitem{display:flex;flex-direction:column;align-items:flex-start;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:7px 9px;min-width:0}
.vitem .am{font-size:1.15rem;line-height:1.25}
.vitem small{color:var(--muted);font-size:.74rem;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.vitem[aria-pressed="true"]{border-color:var(--accent);background:var(--tint)}
button,.chip,.keys button,.forms button{touch-action:manipulation}
/* fidel chart */
.chartbox{overflow-x:auto;background:var(--surface);border:1px solid var(--line);border-radius:12px}
.chart{border-collapse:collapse;width:100%}
.chart th{font-size:.78rem;color:var(--muted);font-weight:600;padding:6px 2px;position:sticky;top:0;background:var(--surface)}
.chart td{padding:0;border-top:1px solid var(--line);text-align:center}
.chart td:first-child{font-size:.8rem;color:var(--gold);font-style:italic;padding:0 8px;text-align:left}
.chart button{font-family:var(--f-fidel);font-size:1.3rem;width:100%;min-width:36px;padding:6px 0;border-radius:6px}
.chart button[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink)}
.peek{position:sticky;top:var(--head-h,104px);z-index:3;background:var(--tint);border-radius:12px;padding:10px 14px;display:flex;align-items:center;gap:14px;margin:10px 0}
.peek .am{font-size:2.4rem;line-height:1.1}
.peek b{font-size:1.2rem;color:var(--gold);font-style:italic}
.peek small{display:block;color:var(--muted)}
/* the letter box never changes size whichever letter is tapped: one line for the sound, one for the order, one kept for the "bare consonant" note */
.peek .am{flex:0 0 auto;display:flex;align-items:center;gap:4px;white-space:nowrap}
.peek .pkch{width:1.3em;text-align:center}
.peek .rep{font-size:1.05rem;margin:0 0 0 -6px}
.peek .pktxt{flex:1;min-width:0}
.peek .pktxt b,.peek .pktxt small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.peek .pktxt b{display:block}
.peek .pkgap{visibility:hidden;flex:0 0 auto}
/* typing */
.tin{width:100%;font-family:var(--f-fidel);font-size:1.6rem;padding:6px 12px;border-radius:12px;border:1.5px solid var(--line);background:var(--surface);color:var(--ink);text-align:center;min-height:50px}
.tin.ok{border-color:var(--good);background:var(--good-bg)} .tin.no{border-color:var(--bad);background:var(--bad-bg)}
.tin.en{font-family:var(--f-body);font-size:1.2rem}   /* typed English answers (Test tab, "Answer by: Type it") */
.ansbar{margin:10px 0 4px;justify-content:flex-start}
.ansbar .mini{flex:1 1 auto;grid-auto-columns:1fr}
.q.slim{padding:10px 14px;margin:8px 0}
.q.slim .big{font-size:1.25rem;margin-top:2px}
.kbd .tin{min-height:44px;font-size:1.5rem;padding:4px 10px;margin-bottom:6px}
.kbd{position:sticky;bottom:0;z-index:4;background:var(--bg);border-top:1px solid var(--line);margin:6px -16px 0;padding:6px 10px calc(8px + env(safe-area-inset-bottom,0px))}
.forms{display:flex;flex-wrap:nowrap;gap:4px;height:52px;margin:0 0 6px;align-items:center;overflow-x:auto;scrollbar-width:none}
.forms::-webkit-scrollbar{display:none}
.forms button{font-family:var(--f-fidel);font-size:1.4rem;flex:1 0 40px;max-width:56px;height:50px;border-radius:9px;background:var(--accent);color:var(--accent-ink);display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1}
.forms button small{font-family:var(--f-body);font-size:.6rem;opacity:.9;font-style:italic;margin-top:2px}
.forms .hint{color:var(--muted);font-size:.85rem}
.keys{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.keys button{font-family:var(--f-fidel-sans);font-size:1.2rem;height:36px;border-radius:8px;background:var(--surface);border:1px solid var(--line)}
.keys button[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.keys .fn{font-family:var(--f-body);font-size:.82rem;font-weight:600}
.keys .w2{grid-column:span 2} .keys .w3{grid-column:span 3}
.keys .go{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.kbar{display:flex;justify-content:space-between;align-items:center;margin-top:6px;gap:10px;flex-wrap:wrap}
.link{color:var(--accent);font-size:.85rem;text-decoration:underline;padding:6px 0}
.keytab td{padding:7px 10px;border-top:1px solid var(--line);font-size:.92rem;vertical-align:top}
.keytab tr:first-child td{border-top:0}
.keytab td:first-child{color:var(--gold);font-style:italic;font-weight:600;white-space:nowrap}
.keytab{width:100%;border-collapse:collapse}
@media (max-width:360px){.row{grid-template-columns:3.8rem 1fr}.row .en{grid-column:2;text-align:left}}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
.daily{display:grid;gap:12px;background:linear-gradient(180deg,var(--hero),var(--surface) 70%);border:1.5px solid var(--sea);border-radius:14px;padding:14px;margin-top:14px}
.daily b{display:block;font-size:1.05rem}.daily small{color:var(--muted)}
.daily label.sel{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:.95rem;font-weight:600;padding:0;border:0;background:none;min-height:0}
.built{min-height:62px;display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:10px;border:1.5px dashed var(--line);border-radius:12px;margin-top:10px}
.built.right{border-style:solid;border-color:var(--good);background:var(--good-bg)}
.built.wrong{border-style:solid;border-color:var(--bad);background:var(--bad-bg)}
.tiles{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.tile{background:var(--surface);border:1.5px solid var(--line);border-radius:10px;padding:8px 14px;font-size:1.3rem;line-height:1.3;touch-action:manipulation}
.tile.used{opacity:.3}
/* transcription under a word tile (shown or hidden by the Transcription switch, like all .rom) */
.tile .rom{display:block;font-size:.72rem;line-height:1.15;margin-top:1px;font-family:var(--f-body)}
.tile{display:inline-flex;flex-direction:column;align-items:center}
.q .bigrom{display:block;font-size:1rem;margin-top:2px}
.q .sub .rom{font-size:inherit}
.bintro{margin:4px 0 14px}
.bintro summary{cursor:pointer;list-style-position:outside}
.bintro p,.bintro ul{margin:8px 0 0}
.bintro ul{padding-left:20px}
.bintro li{margin:4px 0}
.ans{display:flex;flex-direction:column;margin:6px 0 0}.ans .am{font-size:1.35rem}
.topic[disabled]{opacity:.6;cursor:default}
.ncard{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 12px;display:grid;grid-template-columns:auto 1fr;gap:0 10px;align-items:center}
.ncard .sym{font-size:2.1rem;line-height:1.2;grid-row:span 3;min-width:1.3em;text-align:center;color:var(--accent)}
.ncard .dig{font-weight:700;font-size:1.05rem}.ncard .am{font-size:1.25rem;line-height:1.3}.ncard .rom{font-size:.85rem}
.ntry{display:flex;gap:8px;margin:10px 0}
.ntry input{flex:1;min-width:0;font:inherit;font-size:1.3rem;padding:10px 12px;border:1.5px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink)}
.keys.npad{grid-template-columns:repeat(5,1fr)}
.keys.npad button{font-size:1.5rem}.keys.npad .fn{font-size:.9rem}
.ncard .sym.am{font-size:2.2rem;line-height:1.2}
/* audio */
.say{display:inline-flex;align-items:center;justify-content:center;width:1.7em;height:1.7em;margin:0 .25em;border-radius:50%;background:var(--tint);color:var(--accent);font-size:.72rem;line-height:1;vertical-align:middle;flex:none}
.am .say{font-family:var(--f-body);font-size:max(.45em,.7rem);margin-left:.5em}
.say:hover{background:var(--accent);color:var(--accent-ink)}
.say.big{width:2.6em;height:2.6em;font-size:1rem;margin:10px auto 0;display:flex}
/* sentence builder */
.slots .tile{cursor:default}
.tile.filled{display:inline-flex;flex-direction:column;align-items:center;border-color:var(--accent)}
.tile.filled .rom{font-size:.72rem;line-height:1.1}
.tile.gap{color:var(--muted);min-width:3.2rem;text-align:center;border-style:dashed;font-family:var(--f-body)}
.tile.gap.now{border-color:var(--gold);color:var(--gold);font-weight:700}
.slot-opts{margin-top:6px}
.tile.no{border-color:var(--bad);background:var(--bad-bg);color:var(--bad);opacity:.75}
.bset{margin-top:12px}
.bset h4{margin-bottom:4px}
.bset > .count{margin:10px 0 4px}
.bset .bhelp{margin:6px 0 0;font-size:.82rem}
.bset .sel{width:100%}
.wrapchips{flex-wrap:wrap;overflow:visible;padding:2px 0}
/* profiles and backup */
.topic.on{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.pfrow{display:flex;gap:8px;flex-wrap:wrap;align-items:stretch}
.pfrow .btn{flex:1 1 auto}
.ntry.pfrow input{font-size:1rem}
.ntry.pfrow .btn{flex:none;padding:12px 22px}
.codebox{display:block;width:100%;margin:10px 0 8px;font:.78rem/1.35 ui-monospace,SFMono-Regular,Menlo,monospace;padding:8px 10px;border:1.5px solid var(--line);border-radius:10px;background:var(--bg);color:var(--ink);resize:vertical;word-break:break-all}
.filebtn{position:relative;cursor:pointer}
.filebtn input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
.btn.danger{background:var(--bad);border-color:var(--bad);color:var(--bad-ink)}
.note.warn{border-color:var(--bad);background:var(--bad-bg)}
.count.bad{color:var(--bad)}
/* listening */
.lsplay{display:flex;justify-content:center;gap:10px;margin:12px 0 4px;flex-wrap:wrap}
.lsbtn{display:inline-flex;align-items:center;gap:8px;padding:14px 22px;border-radius:999px;background:var(--accent);color:var(--accent-ink);font-weight:700;font-size:1.05rem;min-height:52px}
.lsbtn span{font-size:1.1rem;line-height:1}
.lsbtn.slow{background:var(--tint);color:var(--accent);font-weight:600}
.heard{display:flex;flex-direction:column;align-items:center;gap:2px;margin-top:8px}
.heard .am{font-size:2rem;line-height:1.25}
.heard .en{color:var(--muted);font-size:.95rem}
/* dialogues: chat bubbles, speaker A on the left, B on the right; your lines are tinted */
.dtitle{margin-top:16px}
.dbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;flex-wrap:wrap}
.dbar .btn{padding-left:18px;padding-right:18px}
.dlg{display:flex;flex-direction:column;gap:10px;margin-top:14px}
.bub{max-width:86%;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:8px 12px 10px;display:flex;flex-direction:column;transition:border-color .15s,box-shadow .15s}
.bub.l{align-self:flex-start;border-bottom-left-radius:4px}
.bub.r{align-self:flex-end;border-bottom-right-radius:4px}
.bub.you{background:var(--tint);border-color:var(--accent)}
.bub.now{border-color:var(--gold);box-shadow:0 0 0 2px var(--gold)}
.bwho{font-size:.75rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.bline{display:flex;align-items:flex-start;gap:8px}
.bline .am{font-size:1.3rem;line-height:1.35}
.bub .en{color:var(--muted);font-size:.9rem}
.dparts{grid-template-columns:1fr 1fr}
.dturn{margin-top:16px;padding-top:12px;border-top:1px dashed var(--line)}
.dturn .kind{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:.78rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:600}
.dturn .kind .mini{text-transform:none;letter-spacing:0}
.dsay{margin:10px 0 12px;font-size:1.02rem}
.dwait{margin-top:14px;font-style:italic}
.dend .btns{grid-template-columns:1fr 1fr}
.bar .mini{max-width:100%;overflow-x:auto}
.bar .mini button{padding:6px 10px}
.dturn .btns{grid-template-columns:1fr}
/* phone app + offline (js/offline.js) */
.offsteps{margin:8px 0 4px;padding-left:22px}
.offsteps li{margin:3px 0}
.offbar{height:8px;border-radius:4px;background:var(--line);overflow:hidden;margin:6px 0 10px}
.offbar i{display:block;height:100%;background:var(--accent);transition:width .2s}
.offtip{max-width:560px;margin:10px auto 0;padding:10px 12px;display:flex;align-items:center;gap:10px;background:var(--tint);border-radius:10px;font-size:.9rem;width:calc(100% - 32px)}
.offtip span{flex:1}
.offx{font-size:1.3rem;line-height:1;color:var(--muted);padding:0 4px}
/* progress page (js/progress.js). Bars use one hue: darker = known better */
.pgtiles{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:14px}
.pgtiles div{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 6px;text-align:center;display:flex;flex-direction:column;gap:2px}
.pgtiles strong{font-size:1.5rem;line-height:1.1;color:var(--accent);font-variant-numeric:tabular-nums}
.pgtiles small{font-size:.74rem;color:var(--muted);line-height:1.2}
@media(max-width:400px){.pgtiles{grid-template-columns:repeat(2,1fr)}}
.pgcal{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;max-width:320px}
.pgcal b{font-size:.7rem;color:var(--muted);text-align:center;font-weight:600}
.pgcal span{aspect-ratio:1;border-radius:5px;background:color-mix(in srgb,var(--line) 55%,var(--surface))}
.pgcal .c1{background:color-mix(in srgb,var(--accent) 35%,var(--surface))}
.pgcal .c2{background:color-mix(in srgb,var(--accent) 65%,var(--surface))}
.pgcal .c3{background:var(--accent)}
.pgcal .cf{background:transparent;border:1px dashed var(--line)}
.pgcal .now{outline:2px solid var(--gold);outline-offset:1px}
.pgfc{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;align-items:end;height:100px;max-width:420px}
.pgfc div{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:3px}
.pgfc i{display:block;width:70%;max-width:34px;min-height:2px;background:var(--accent);border-radius:4px 4px 0 0}
.pgfc .n{font-size:.78rem;font-variant-numeric:tabular-nums;color:var(--ink);min-height:1em}
.pgfc small{font-size:.72rem;color:var(--muted)}
.pglist{display:flex;flex-direction:column;gap:8px;margin-top:8px}
.pgrow{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:7px;text-align:left;width:100%}
.pgname{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.pgname b{font-size:.95rem;font-weight:600}
.pgname span{font-size:.8rem;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.pgbar{display:flex;height:9px;border-radius:5px;background:var(--line);overflow:hidden;gap:1px}
.pgbar i{display:block;height:100%}
.pgbar .m,.pgkey .m{background:var(--accent)}
.pgbar .k,.pgkey .k{background:var(--pg-k)}
.pgbar .l,.pgkey .l{background:var(--pg-l)}
.pgkey{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:.78rem;color:var(--muted)}
.pgkey span{display:inline-flex;align-items:center;gap:5px}
.pgkey i{width:12px;height:12px;border-radius:3px;background:var(--line);display:inline-block}
/* daily goal and streak (js/goal.js) */
.pggoal{margin-top:12px;display:flex;flex-direction:column;gap:12px}
.ggtop{display:flex;align-items:center;gap:14px}
.ggring{position:relative;flex:none;width:76px;height:76px}
.ggring .gnum{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.05}
.ggring .gnum b{font-size:1.35rem;color:var(--accent);font-variant-numeric:tabular-nums}
.ggring .gnum small{font-size:.7rem;color:var(--muted)}
.gring{display:block}
.gring circle{fill:none;stroke-width:3.6}
.gring .t{stroke:color-mix(in srgb,var(--line) 70%,var(--surface))}
.gring .f{stroke:var(--accent);stroke-linecap:round;transition:stroke-dasharray .4s ease}
.gring.full .f{stroke:var(--good)}
.ggtext b{font-size:1.02rem}
.ggtext p{margin:3px 0 0;font-size:.92rem;color:var(--muted)}
.ggpick{display:flex;flex-direction:column;gap:6px}
.ggpick .count{font-size:.8rem}
.ggpick .chips{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;padding:0;overflow:visible}
.ggpick .chip{padding:7px 0;text-align:center;font-variant-numeric:tabular-nums}
.ggrest{display:flex;gap:8px;align-items:flex-start;font-size:.88rem;color:var(--muted)}
.ggrest input{margin-top:3px;accent-color:var(--accent)}
.pgcal .g{position:relative}
.pgcal .g::after{content:"";position:absolute;left:50%;top:50%;width:30%;height:30%;transform:translate(-50%,-50%);border-radius:50%;background:var(--surface)}
.ggdone{margin:8px auto 0;font-weight:600;color:var(--good)}
.ggafter{margin:6px auto 0}
.wlgoal{display:flex;align-items:center;gap:10px;margin:0 auto 12px;padding:8px 14px 8px 8px;border-radius:999px;background:var(--surface);border:1px solid var(--line);text-align:left;width:max-content;max-width:100%}
.wlgoal b{display:block;font-size:.95rem}
.wlgoal small{display:block;font-size:.82rem;color:var(--muted)}
.wlgoal .gring circle{stroke-width:4.4}
/* narrow phones: each tab only as wide as its word needs, so long names (Numbers, Progress) don't touch their neighbours */
/* welcome page (js/welcome.js) */
body.welcoming .offtip{display:none}
.wlhero{margin-top:18px;padding:22px 18px 18px;border-radius:16px;background:var(--hero);text-align:center}
.wlhero h2{font-size:1.45rem;line-height:1.2;margin:6px auto 8px;max-width:22ch}
.wlhero .lead{margin:0 auto 16px;color:var(--ink);opacity:.82}
.wlhi{margin:0;display:flex;align-items:center;justify-content:center;gap:4px;flex-wrap:wrap}
.wlhi .am{font-size:2.6rem;line-height:1.2;color:var(--accent);font-weight:700}
.wlhi .rom{font-size:1rem}
.wlgo{font-size:1.05rem;padding:14px}
.wlfeats{display:grid;grid-template-columns:1fr;gap:8px}
@media (min-width:520px){ .wlfeats{grid-template-columns:1fr 1fr} }
.wlfeat{display:flex;gap:12px;align-items:flex-start;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px}
.wlfeat b{display:block;font-size:.98rem}
.wlfeat small{display:block;color:var(--muted);font-size:.86rem;line-height:1.4;margin-top:2px}
.wlicon{flex:none;width:2.2rem;height:2.2rem;border-radius:50%;background:var(--tint);color:var(--accent);display:flex;align-items:center;justify-content:center;font-size:1.05rem}
.wlicon .am{font-size:1.25rem;font-weight:700}
.wlsteps{margin:0;padding:0;list-style:none;counter-reset:wl;display:flex;flex-direction:column;gap:8px}
.wlsteps li{counter-increment:wl;position:relative;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px 12px 12px 52px;font-size:.94rem}
.wlsteps li::before{content:counter(wl);position:absolute;left:12px;top:11px;width:28px;height:28px;border-radius:50%;background:var(--accent);color:var(--accent-ink);font-weight:700;display:flex;align-items:center;justify-content:center;font-size:.9rem}
.wlhonest p{margin:8px 0}
.wllink{text-align:center;margin-top:22px}
.wlfoot{display:flex;justify-content:center;margin:32px 0 0;padding-top:14px;border-top:1px solid var(--line);font-size:.9rem;color:var(--muted)}
/* search (js/find.js) */
.findq{width:100%;font-size:1.05rem;padding:12px 14px;margin:10px 0 8px}
.findlist .frow{grid-template-columns:1fr}
.frow .form .am{display:inline;font-size:1.3rem}
.frow .rom{display:block}
.fen{display:block;font-weight:500;margin-top:2px}
.fplaces{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:4px;font-size:.85rem}
.hit{animation:hit 2.2s ease-out}
@keyframes hit{0%,40%{background:var(--tint);box-shadow:0 0 0 3px var(--gold)}100%{box-shadow:0 0 0 3px transparent}}
/* record yourself (js/recorder.js) */
.mic{display:inline-flex;align-items:center;justify-content:center;width:1.7em;height:1.7em;margin:0 .15em;border-radius:50%;background:var(--tint);color:var(--bad);font-size:.85rem;line-height:1;vertical-align:middle;flex:none}
.findback{display:block;margin-bottom:2px}
.bigbtns{display:flex;justify-content:center;align-items:center;gap:12px;margin-top:10px}
.bigbtns .say.big{margin:0}
.bigbtns .mic{width:2.6em;height:2.6em;font-size:1.05rem;margin:0}
.recsheet{position:fixed;left:0;right:0;bottom:0;z-index:20;background:var(--surface);border-top:1px solid var(--line);box-shadow:0 -6px 24px rgba(0,0,0,.18);border-radius:16px 16px 0 0;padding:14px 16px calc(14px + env(safe-area-inset-bottom))}
.recsheet[hidden]{display:none}
.rsinner{max-width:560px;margin:0 auto;display:flex;flex-direction:column;gap:10px}
.rshead{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.rshead>div{display:flex;flex-direction:column;min-width:0}
.rshead .am{font-size:1.6rem;line-height:1.25}
.rshead .en{color:var(--muted);font-size:.9rem}
.rsx{font-size:1.7rem;line-height:1;color:var(--muted);padding:0 6px}
.recbtn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;font-size:1.05rem}
.recbtn i{width:14px;height:14px;border-radius:50%;background:var(--bad)}
.recbtn.going{background:var(--bad-bg);border-color:var(--bad);color:var(--bad)}
.recbtn.going i{border-radius:3px;animation:recpulse 1s infinite}
@keyframes recpulse{50%{opacity:.35}}
.rsplay{display:flex;gap:8px;flex-wrap:wrap}
.rsplay .btn{flex:1 1 auto;padding:10px}
.rsplay .btn.on{border-color:var(--accent);color:var(--accent)}
body.recopen main{padding-bottom:240px}
.am .mic{font-family:var(--f-body);font-size:max(.5em,.8rem);margin-left:.1em}
.sbtns{white-space:nowrap}
@media (max-width:400px){ .canrec .vrow .en{max-width:8.5rem} }
/* report a mistake (js/report.js) */
.rep{display:inline-flex;align-items:center;justify-content:center;width:1.7em;height:1.7em;margin:0 .1em;border-radius:50%;color:var(--muted);font-size:.8rem;line-height:1;vertical-align:middle;flex:none;opacity:.8;background:transparent;border:1px solid var(--line)}
.rep svg{width:1.25em;height:1.25em}
.rep:hover,.rep:focus-visible{opacity:1;background:var(--tint);color:var(--accent)}
.am .rep{font-family:var(--f-body);font-size:max(.45em,.75rem);margin-left:.1em}
.bline .rep{margin-left:auto}
.bigbtns .rep.big{width:2.6em;height:2.6em;font-size:1rem;margin:0;border:1px solid var(--line)}
.repq{margin:8px 0 0;text-align:center}
.repq .link{display:inline-flex;align-items:center;gap:6px;color:var(--muted)}
.wlfoot{gap:10px;align-items:center;flex-wrap:wrap}
.repsheet{position:fixed;left:0;right:0;bottom:0;z-index:21;background:var(--surface);border-top:1px solid var(--line);box-shadow:0 -6px 24px rgba(0,0,0,.18);border-radius:16px 16px 0 0;padding:14px 16px calc(14px + env(safe-area-inset-bottom));max-height:92vh;overflow-y:auto}
.repsheet[hidden]{display:none}
.rpinner{max-width:560px;margin:0 auto;display:flex;flex-direction:column;gap:10px}
.rphead{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;padding-bottom:4px;border-bottom:3px solid var(--sun)}
.rphead>div{display:flex;flex-direction:column;min-width:0;padding-bottom:8px}
.rphead .am{font-size:1.5rem;line-height:1.25}
.rphead .en{color:var(--muted);font-size:.9rem}
.rptitle{font-size:1.15rem}
.rplab{display:block;font-weight:600;font-size:.92rem;margin:0 0 6px}
.rplab small{font-weight:400;color:var(--muted);margin-left:4px}
.rpchips{display:flex;flex-wrap:wrap;gap:6px}
.rpchips .chip{white-space:normal}
.rpin{width:100%;font:inherit;font-size:1rem;padding:10px 12px;border:1.5px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);resize:vertical}
.rpin:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--sea) 55%,transparent)}
.rpsend{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:8px;margin-top:4px}
.rpsend .btn{padding:11px 8px}
.rpsend .btn:disabled{opacity:.45;cursor:not-allowed}
.rpmsg{margin:0;min-height:1.3em}
body.repopen main{padding-bottom:420px}
@media (max-width:400px){ .rpsend{grid-template-columns:1fr 1fr} .rpsend .btn.primary{grid-column:1/-1} }

/* ---------- header ----------
   Row 1: name on the left; transcription, speed, search and profile on the right.
   Row 2: the six sections. Both rows share the page column, so nothing sits outside it. */
header{position:sticky;top:0;z-index:5;background:var(--head-bg);color:var(--head-ink);box-shadow:0 1px 0 rgba(0,0,0,.08),0 2px 8px rgba(0,0,0,.08)}
.head{max-width:560px;margin:0 auto;padding:8px 16px 10px;display:flex;flex-direction:column;gap:8px}
.brand{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:38px}
.brand h1{margin:0;font-size:1.05rem;font-weight:700;display:flex;align-items:baseline;white-space:nowrap;flex:none}
/* the name sits exactly on the page edge; hovering underlines it in sand instead of drawing a box that would stick out */
.brandbtn{display:inline-flex;align-items:baseline;gap:8px;padding:2px 0;margin:0;border-radius:4px;font-weight:inherit;color:inherit;white-space:nowrap;flex:none;text-decoration:none;text-underline-offset:5px;text-decoration-thickness:2px}
.brandbtn:hover{text-decoration:underline;text-decoration-color:var(--head-gold)}
.brand h1 span{font-family:var(--f-fidel);font-size:1.35rem;color:var(--head-ink)}
.brand h1 em{font-style:normal;color:var(--head-muted);font-weight:600}
.tools{display:flex;align-items:center;gap:6px;min-width:0}
.tools>button{flex:none;height:34px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--head-ink);white-space:nowrap}
.tools>button:hover{background:var(--head-soft)}
.romtoggle{gap:7px;padding:0 8px;font-size:.8rem;font-weight:600}
.romtoggle i{width:30px;height:18px;border-radius:9px;background:var(--head-track);position:relative;display:inline-block;transition:background .15s}
.romtoggle i::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:var(--head-knob);transition:left .15s}
.romtoggle[aria-pressed="true"] i{background:var(--head-gold)}
.romtoggle[aria-pressed="true"] i::after{left:14px}
.romtoggle .short{display:none}
.ratebtn{font-size:.8rem;font-weight:700;padding:0;width:4.2rem;flex:none;justify-content:center;text-align:center;background:var(--head-soft);font-variant-numeric:tabular-nums}
.ratebtn::before{content:"▶";font-size:.6rem;margin-right:4px}
.ratebtn.slow{background:var(--head-gold);color:var(--head-gold-ink)}
.findbtn{width:34px}
.findbtn[aria-pressed="true"]{background:var(--head-soft)}
.whobtn{gap:7px;padding:0 10px 0 3px;font-size:.82rem;font-weight:600;background:var(--head-soft);max-width:10rem;flex:0 1 auto!important;min-width:34px}
.whobtn .av{flex:none;width:28px;height:28px;border-radius:50%;background:var(--head-gold);color:var(--head-gold-ink);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:.85rem}
.whobtn .nm{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1;text-align:left}
/* where the name shows (600px and up) the button is always the same width, so a short or long name
   never moves the other buttons or the tabs; names are limited to 10 letters (NAME_MAX), and an older, longer name is shrunk to fit (fitName) */
@media (min-width:600px){ .whobtn{width:7.5rem;max-width:none;flex:none!important;justify-content:flex-start} }
@media (min-width:960px){ .whobtn{width:7.5rem} }
@media (min-width:1200px){ .whobtn{width:9rem} }
.whobtn[aria-pressed="true"]{box-shadow:inset 0 0 0 2px var(--head-ink)}
/* set by fitHead() in app.js when the top bar would otherwise run past its edge */
body.whotight .whobtn{width:auto!important;padding:0 3px;flex:none!important} body.whotight .whobtn .nm{display:none}
body.romtight .romtoggle .full{display:none} body.romtight .romtoggle .short{display:inline}
/* the six tabs: each takes its word's width plus an equal share of the spare room, so a longer word
   never spills past its highlight or the edge of the bar */
.seg{display:flex;background:var(--head-soft);border-radius:11px;padding:3px;gap:2px}
.seg button{flex:1 1 auto;min-width:0;white-space:nowrap;padding:8px 6px;border-radius:8px;font-weight:600;color:var(--head-muted);font-size:.86rem;line-height:1.2;text-align:center}
.seg button:hover{color:var(--head-ink)}
.seg button[aria-selected="true"]{background:var(--tab-on);color:var(--tab-on-ink);box-shadow:0 1px 3px rgba(0,0,0,.18)}
.seg .short{display:none}
/* ፊደል (Fidel): one tab, with a Letters / Numbers switch at the top of the page */
.fnsw{display:grid;grid-template-columns:1fr 1fr;gap:3px;background:var(--tint);border-radius:11px;padding:3px;margin-top:14px}
.fnsw button{padding:9px 6px;border-radius:8px;font-weight:600;font-size:.95rem;color:var(--muted)}
.fnsw button .am{font-size:1.1em;margin-right:4px}
.fnsw button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.12)}
/* Learn: Fidel · Units · Stories · Culture. Each part takes its word's width plus an equal share. */
.lrnsw{display:flex}
.lrnsw button{flex:1 1 auto;min-width:0;white-space:nowrap;padding:9px 4px;display:inline-flex;align-items:center;justify-content:center;gap:4px;line-height:1.2}
.lrnsw button .am{margin-right:0;line-height:1}
.lrnsw + .fnsw{margin-top:8px}
@media (max-width:420px){ .lrnsw button{font-size:.86rem;padding:9px 2px} }
@media (max-width:350px){ .lrnsw button{font-size:.78rem;padding:9px 1px} }
/* phones: the English name sits in small letters under the Amharic, so both fit beside the tools
   without making the bar taller; the profile name drops (the initial stays) and the switch label shortens */
@media (max-width:440px){
  .brandbtn{flex-direction:column;align-items:flex-start;gap:0;padding:0;line-height:1}
  .brand h1 span{font-size:1.25rem;line-height:1.05}
  .brand h1 .long{font-size:.72rem;letter-spacing:.02em;line-height:1.1;margin-top:1px}
}
@media (max-width:599px){
  .romtoggle .full{display:none} .romtoggle .short{display:inline}
  .seg .full{display:none} .seg .short{display:inline}
  .whobtn{padding:0 3px} .whobtn .nm{display:none}
}
@media (max-width:400px){ .seg button{font-size:.78rem;padding:8px 3px} }
@media (max-width:350px){ .seg{gap:1px} .seg button{font-size:.74rem;padding:8px 2px} }
/* mid widths (tablet, small laptop): the bar is busy, so the switch shows its short label */
@media (min-width:600px) and (max-width:959px){ .romtoggle .full{display:none} .romtoggle .short{display:inline} }
@media (min-width:960px) and (max-width:1023px){ .romtoggle .full{display:none} .romtoggle .short{display:inline} }
@media (max-width:340px){ .head{padding-left:10px;padding-right:10px} .tools{gap:3px} .romtoggle .short{display:none} .romtoggle{padding:0 4px} }
.wlname{margin:0 0 6px;font-size:.78rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--gold)}
/* fidel chart: the big play button in the letter box (tapping a letter no longer plays it) */
.peek .say{margin:0 0 0 auto;width:2.6rem;height:2.6rem;font-size:1rem;background:var(--accent);color:var(--accent-ink)}
.peek .say:hover{filter:brightness(1.1)}
.wlskip{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:12px;font-size:.88rem;color:var(--muted);cursor:pointer}
.wlskip input{width:18px;height:18px;accent-color:var(--accent);margin:0}
/* colour schemes on the welcome page (js/schemes.js, colours in css/schemes.css). Each button shows its palette. */
.wlcol{display:block;margin:10px auto 0;font-size:.9rem}
#colours{scroll-margin-top:120px}
.schint{margin:-4px 0 8px}
.schgrid{display:grid;grid-template-columns:1fr;gap:8px}
@media (min-width:520px){ .schgrid{grid-template-columns:1fr 1fr} }
@media (min-width:960px){ .schgrid{grid-template-columns:repeat(3,minmax(0,1fr))} }
@media (min-width:1200px){ .schgrid{grid-template-columns:repeat(5,minmax(0,1fr))} }
.schbtn{position:relative;display:flex;flex-direction:column;align-items:stretch;gap:3px;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 12px 11px}
.schbtn:hover{border-color:var(--accent)}
.schbtn[aria-checked="true"]{border-color:var(--accent);box-shadow:inset 0 0 0 1.5px var(--accent)}
.schbtn b{font-size:.95rem;padding-right:28px}
.schbtn>small{color:var(--muted);font-size:.84rem;line-height:1.35}
.schsw{display:flex;height:26px;border-radius:7px;overflow:hidden;margin-bottom:5px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}
.schsw i{flex:1}
.schtick{position:absolute;top:44px;right:10px;width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.8rem;font-weight:700}
.schbtn[aria-checked="true"] .schtick{background:var(--accent);color:var(--accent-ink)}

/* ---------- dropdowns ----------
   One look for every unit picker: a rounded field with its own chevron, in the theme colours. */
select.sel,.sel select{-webkit-appearance:none;appearance:none;font:inherit;font-size:.95rem;font-weight:600;color:var(--ink);background-color:var(--surface);
  background-image:linear-gradient(45deg,transparent 50%,var(--accent) 50%),linear-gradient(135deg,var(--accent) 50%,transparent 50%);
  background-position:calc(100% - 19px) 52%,calc(100% - 14px) 52%;background-size:5px 5px;background-repeat:no-repeat;
  border:1.5px solid var(--line);border-radius:10px;padding:9px 38px 9px 12px;min-height:42px;max-width:100%;cursor:pointer;transition:border-color .15s,box-shadow .15s}
select.sel:hover,.sel select:hover{border-color:var(--sea)}
select.sel:focus-visible,.sel select:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--sea) 55%,transparent)}
.sel select{min-width:9rem}
input.sel{border:1.5px solid var(--line);border-radius:10px;min-height:42px}

/* ---------- progress ----------
   Each chart sits in a full-width card like the rest of the app, with the chart centred inside it. */
.pgcard{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:14px 14px 12px}
.pgcard .pgcal{margin:0 auto;max-width:300px}
.pgcard .pgfc{margin:6px auto 0;max-width:none}
.pgcard p.count{text-align:center;margin:10px 0 0}
.pgcard .pgintro{margin:0 0 10px;font-size:.9rem;color:var(--muted);text-align:left}
.pgcal .c1{background:var(--sage)} .pgcal .c2{background:var(--sea)} .pgcal .c3{background:var(--accent)}
.pgfc i{background:linear-gradient(180deg,var(--accent),color-mix(in srgb,var(--accent) 70%,var(--sea)))}
.pgfc div.today i{background:var(--gold)}
.pgfc div.today small{color:var(--ink);font-weight:700}
.pgkey{justify-content:center;margin-bottom:4px}

/* ---------- test menu ----------
   Sections across the top (and as cards on the overview), each opening its own list of tests. */
.tsecs{margin:4px 0 2px}
.tgrid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.tcard{display:flex;flex-direction:column;gap:4px;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 13px;min-height:118px;transition:border-color .15s,transform .1s}
.tcard:hover{border-color:var(--sea)}
.tcard:active{transform:scale(.99)}
.tcard .ticon{width:34px;height:34px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;font-size:1.1rem;background:var(--tint);margin-bottom:2px}
.tcard:nth-child(4n+1) .ticon{background:var(--hero)} .tcard:nth-child(4n+2) .ticon{background:color-mix(in srgb,var(--sea) 40%,var(--surface))}
.tcard:nth-child(4n+3) .ticon{background:color-mix(in srgb,var(--sage) 50%,var(--surface))} .tcard:nth-child(4n) .ticon{background:color-mix(in srgb,var(--sun) 55%,var(--surface))}
.tcard b{font-size:.98rem}
.tcard small{color:var(--muted);font-size:.82rem;line-height:1.35}
.tcard .tn{margin-top:auto;font-size:.76rem;color:var(--gold);font-weight:700}
.tsechead{margin-top:16px}
.tsechead h2{margin:0 0 2px}
@media (max-width:340px){ .tgrid{grid-template-columns:1fr} }
@media (min-width:600px){ .tsecs{flex-wrap:wrap;overflow:visible} }

/* ---------- laptop and desktop ----------
   From 960px wide the app stops being a phone column: the page is up to 1120px wide, the header is
   one row (name, sections, tools), and lists of cards sit two or more across. Phones are unchanged.
   Quizzes and the typing keyboard stay a comfortable reading width in the middle. */
@media (min-width:960px){
  :root{--head-h:64px}
  .wrap,.head{max-width:1120px;padding-left:28px;padding-right:28px}
  .head{flex-direction:row;align-items:center;gap:20px;padding-top:10px;padding-bottom:10px}
  .brand{display:contents}
  .brand h1{order:1}
  .seg{order:2;flex:1 1 auto;min-width:360px;max-width:620px;margin:0 auto}
  .tools{order:3}
  .wrap{font-size:1.02rem}
  /* card lists: units, tests, progress rows, search results */
  .stack:has(> .topic){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .stack:has(> .topic) > .topic{height:100%}
  .pglist{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .tgrid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
  .pgtiles{gap:12px}
  .pgpair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:stretch}
  .pgpair>div{display:flex;flex-direction:column}
  .pgpair .pgcard{flex:1}
  .pggoal{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:28px;align-items:center}
  .ggpick{grid-column:2;grid-row:1}
  .ggrest{grid-column:2}
  .ggtop{grid-row:1/span 2}
  .wlfeats{grid-template-columns:repeat(3,minmax(0,1fr))}
  .grid2{grid-template-columns:repeat(4,minmax(0,1fr))}
  .vgrid{max-height:300px}
  /* text and cards flow to the full content width, so they resize with the window */
  p{max-width:none}
  /* tab rows and switches spread across the width instead of sitting bunched on the left */
  .chips{flex-wrap:wrap;overflow:visible}
  .chips .chip{flex:1 0 auto;text-align:center;padding-left:12px;padding-right:12px}
  /* long lists (topics, units) line up in an even grid rather than one stretched last row */
  .chips.many{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}
  .chips.many .chip{white-space:normal}
  .bar .mini,.bset .mini,.note .mini{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);flex:1 1 auto;overflow:visible}
  .bset .mini,.note .mini{width:100%}
  .bar .mini button,.bset .mini button,.note .mini button{padding:8px 12px}
  .bar .sel,.bar select{flex:0 0 auto}
  /* My mistakes and Review: two equal halves */
  .stack.duo{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .wlhero{padding:34px 40px 28px}
  /* word, sentence and verb tables: two columns of rows */
  .tbl.wl2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .tbl.wl2 .row:nth-child(2){border-top:0}
  .tbl.wl2 .row:nth-child(odd){border-right:1px solid var(--line)}
  .tbl.wl2 .vrow .en{max-width:none}
  /* focused screens keep a phone-like width in the middle */
  body.focus .wrap{max-width:720px}
}
/* Card lists fill every row: an odd card out on its own row stretches to the full width (two across),
   and with three across the last one or two cards share the row between them. Four cards sit two by two. */
@media (min-width:960px) and (max-width:1279px){
  .stack:has(> .topic) > .topic:last-child:nth-child(odd){grid-column:1 / -1}
}
@media (min-width:1280px){
  .stack:has(> .topic){grid-template-columns:repeat(6,minmax(0,1fr))}
  .stack:has(> .topic) > *{grid-column:span 2}
  .stack:has(> .topic) > .topic:last-child:nth-child(3n+1){grid-column:span 6}
  .stack:has(> .topic) > .topic:nth-last-child(2):nth-child(3n+1),.stack:has(> .topic) > .topic:last-child:nth-child(3n+2){grid-column:span 3}
  .stack:has(> .topic:nth-child(4):last-child) > .topic{grid-column:span 3!important}
  .stack.duo > *{grid-column:auto!important}
}

/* ---------- games (games.js) ----------
   Cards and squares in the summer palette: sea glass for a choice, sage for a match, sand for bingo. */
.gmhead{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:8px 0 10px}
.gmclock{font-weight:700;font-variant-numeric:tabular-nums;color:var(--accent);font-size:1.1rem;min-width:3ch;text-align:right}
.gmgrid{display:grid;gap:8px}
.gmgrid.cols{grid-template-columns:1fr 1fr}
.gmgrid.mem{grid-template-columns:repeat(4,minmax(0,1fr))}
.gmcard{min-height:64px;border-radius:12px;border:1.5px solid var(--line);background:var(--surface);padding:8px 10px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:1px;font-weight:600;font-size:.95rem;line-height:1.25;touch-action:manipulation;transition:background .15s,border-color .15s,opacity .3s,transform .1s}
.gmcard:active{transform:scale(.98)}
.gmcard .am{font-size:1.35rem;font-weight:500;line-height:1.3}
.gmcard .rom{font-weight:400}
.gmcard.on{border-color:var(--accent);background:color-mix(in srgb,var(--sea) 35%,var(--surface));box-shadow:inset 0 0 0 1px var(--accent)}
.gmcard.no{border-color:var(--bad);background:var(--bad-bg);animation:gmshake .35s}
.gmcard.ok{border-color:var(--good);background:var(--good-bg)}
.gmcard.gone{opacity:.45;cursor:default}
.gmgrid.mem .gmcard{min-height:84px;padding:6px 4px;font-size:.82rem}
.gmgrid.mem .gmcard .am{font-size:1.25rem}
.gmgrid.mem .gmcard:not(.up){background:linear-gradient(140deg,var(--accent),color-mix(in srgb,var(--accent) 70%,var(--sea)));border-color:transparent}
.gmback{font-family:var(--f-fidel);font-size:1.6rem;color:var(--sun);opacity:.85}
.gmhelp{text-align:center;margin-top:12px}
.gmscore{font-size:.95rem;color:var(--muted);transition:color .2s}
.gmscore strong{font-size:1.5rem;color:var(--accent);margin-right:4px;font-variant-numeric:tabular-nums}
.gmscore.good strong{color:var(--good)}
.gmprog{margin:0 0 8px}
.gmprog i{transition:width .15s linear;background:linear-gradient(90deg,var(--accent),color-mix(in srgb,var(--accent) 60%,var(--sea)))}
.gmq{margin:8px 0 12px}
.gmq .big{margin-top:0}
.gmopts{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.gmopts .opt{min-height:64px;justify-content:center;align-items:center;text-align:center;touch-action:manipulation}
@keyframes gmshake{25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}
@media (prefers-reduced-motion:reduce){.gmcard.no,.bcell.no{animation:none}}
.bcall{padding:14px 16px}
.bsnd{font-size:2rem;line-height:1.2;margin-top:4px;min-height:2.4rem}
.bsnd b{font-weight:700;letter-spacing:.02em}
.bcall .lsplay{margin:8px 0 0}
.bcall .lsbtn{padding:10px 18px;min-height:44px;font-size:.95rem}
.bingo{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:12px 0 10px}
.bcell{aspect-ratio:1;border-radius:12px;border:1.5px solid var(--line);background:var(--surface);display:flex;flex-direction:column;align-items:center;justify-content:center;touch-action:manipulation;transition:background .15s,border-color .15s}
.bcell .am{font-size:clamp(1.6rem,8vw,2.3rem);line-height:1.1}
.bcell small{font-size:.72rem}
.bcell.on{background:color-mix(in srgb,var(--sage) 60%,var(--surface));border-color:color-mix(in srgb,var(--good) 60%,var(--line))}
.bcell.line{background:var(--sun);border-color:var(--sun-line);color:var(--sun-ink)}
.bcell.line .rom{color:var(--sun-ink)}
.bcell.no{border-color:var(--bad);background:var(--bad-bg);animation:gmshake .35s}
.bcell.hint{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--sea) 70%,transparent)}
.bcell[disabled]{cursor:default}
.bnone{margin-top:4px}

/* ---------- everyday drills (drills.js) ---------- */
.drline{display:inline-flex;flex-wrap:wrap;align-items:center;gap:2px 4px}
.drline .am{font-family:var(--f-fidel-sans);font-size:1.1rem}
.drline.big .am{font-size:1.35rem}
.drline .rom{flex-basis:100%}
.drpick{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:6px 0 10px}
.drclock{display:flex;gap:16px;align-items:center}
.drclock>div{min-width:0}
.drbig{font-size:1.5rem;font-weight:700;color:var(--accent);margin:2px 0 4px;font-variant-numeric:tabular-nums}
.drbig small{font-size:.85rem;font-weight:500;color:var(--muted)}
.clock{flex:none}
.clock circle{fill:var(--surface);stroke:var(--accent);stroke-width:2.5}
.clock text{font-size:9px;text-anchor:middle;fill:var(--muted);font-family:var(--f-body)}
.clock line{stroke:var(--ink);stroke-linecap:round}
.clock .hh{stroke-width:4}
.clock .mh{stroke-width:2.5;stroke:var(--gold)}
.clock .pin{fill:var(--accent);stroke:none}
.q .clock{display:block;margin:8px auto 0}
.drrow{grid-template-columns:auto 1fr auto}
.drrow .form .am{font-size:1.15rem}
.drprice{grid-template-columns:minmax(0,1fr) auto;row-gap:2px}
.drprice .form{display:flex;flex-direction:column}
.drprice .form .en{text-align:left;font-size:.8rem}
.drprice .drp{font-weight:700;font-variant-numeric:tabular-nums;color:var(--accent);text-align:right}
.drprice .drline{grid-column:1 / -1}
.drsay{width:auto;height:auto;padding:7px 14px;border-radius:999px;font-size:.85rem;font-weight:600;gap:4px}
.drans{text-align:center;margin:10px 0 0}
.drtoday{background:linear-gradient(180deg,var(--hero),var(--surface) 80%);border-color:var(--sea)}
@media (min-width:960px){
  .tgrid{grid-template-columns:repeat(5,minmax(0,1fr))}
  /* eleven section chips: two even rows rather than one stray chip on its own */
  .chips.tsecs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr))}
  .gmgrid.mem .gmcard{min-height:96px}
  .bingo{max-width:420px;margin-left:auto;margin-right:auto}
  .drboard{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .drboard .row:nth-child(2){border-top:0}
  .drboard .row:nth-child(odd){border-right:1px solid var(--line)}
}
.drpick .sel{flex:1 1 0;min-width:0}
.drpick .link{flex:none;padding:0 6px}
.drhol{grid-template-columns:minmax(0,1fr) auto}
.drhol .form{display:flex;flex-direction:column;align-items:flex-start}
.drhol .form .en{text-align:left;font-size:.82rem}
.drhol>.en{display:flex;flex-direction:column;align-items:flex-end;text-align:right}
.drhol>.en .drline{justify-content:flex-end}
.drhol>.en .drline .rom{text-align:right}
.drhol>.en small{font-size:.8rem}
@media (min-width:960px){
  /* no half-empty rows: the last section chip and an odd last row of a two-column list take the spare room */
  .chips.tsecs .chip:last-child:nth-child(6n+5){grid-column:span 2}
  .tbl.wl2 .row:last-child:nth-child(odd){grid-column:1 / -1;border-right:0}
}
/* reading stories and culture notes (js/reader.js) */
.rdgo{display:grid;grid-template-columns:1fr;gap:8px;margin-top:12px}
.rdgo .tcard{min-height:0}
.rdgo .tcard.cu .ticon{background:color-mix(in srgb,var(--sun) 55%,var(--surface))}
.sthead{margin:18px 0 8px;align-items:center}
.sthead h3{margin:0}
.sthead .best{flex:none;font-size:.78rem;color:var(--muted);font-variant-numeric:tabular-nums}
.sthead .best strong{font-size:1rem;color:var(--accent);margin-right:4px}
.sthead .best.untried{background:var(--sun);color:var(--sun-ink);font-weight:600;border-radius:999px;padding:3px 9px;white-space:nowrap}
.rdh span{margin-right:4px}
.rdam{margin:2px 0 0}
.rdam .am{font-size:1.25rem;color:var(--accent);font-weight:700}
.rdhint{margin-top:10px}
.story{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.stl{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:10px 12px;display:flex;flex-direction:column;gap:2px;transition:border-color .15s,box-shadow .15s}
.stl.now{border-color:var(--gold);box-shadow:0 0 0 2px var(--gold)}
.stam{font-family:var(--f-fidel);font-size:1.35rem;line-height:1.6}
.stw{font:inherit;color:inherit;padding:0 2px;margin:0 -2px;border-radius:6px;border-bottom:2px dotted color-mix(in srgb,var(--sea) 80%,transparent)}
.stw:hover{background:var(--tint)}
.stw[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink);border-bottom-color:transparent}
.stam .say{margin-left:8px;vertical-align:middle}
.stl > .en{color:var(--muted);font-size:.92rem}
.stword{margin-top:8px;background:var(--tint);border-left:3px solid var(--accent);border-radius:0 10px 10px 0;padding:8px 12px;display:flex;flex-direction:column;gap:1px}
.stwhead{display:flex;align-items:center;gap:10px}
.stwhead .am{font-size:1.5rem;font-weight:700}
.stx{margin-left:auto;font-size:1.4rem;line-height:1;color:var(--muted);padding:0 4px}
.stword .en{font-weight:500}
.stqs{display:grid;gap:10px}
.stq{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 12px}
.stq p{margin:0 0 8px}
.stopts{display:grid;gap:6px}
.stopts .opt{padding:9px 12px}
.rdnote p{margin:0 0 10px}
.rdnote p:last-child{margin:0}
.rdmore .topic b{font-size:.98rem}
.rdnext{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.rdnext .btn{flex:1 1 220px}
@media (max-width:340px){ .rdgo{grid-template-columns:1fr} }
@media (min-width:960px){
  .rdgrid{grid-template-columns:repeat(4,minmax(0,1fr))}
  /* a few links in a row share the full width rather than bunching on the left */
  .stack.rdfill:has(> .topic){grid-template-columns:repeat(var(--c,2),minmax(0,1fr))}
  .stopts{grid-template-columns:repeat(3,minmax(0,1fr))}
  .stq p{margin-bottom:10px}
}
/* the Ethiopia tab (js/ethiopia.js) */
.ethname{font-size:.8em;font-weight:600;color:var(--muted);margin-left:6px}
.ethfacts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0 14px}
.ethfacts div{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:9px 12px}
.ethfacts dt{font-size:.74rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--gold)}
.ethfacts dd{margin:2px 0 0;font-size:.92rem;line-height:1.3}
@media (min-width:960px){ .ethfacts{grid-template-columns:repeat(3,minmax(0,1fr))} }
