/* Audit pass 2: accessibility fixes. Loaded after dark.css. */
/* contrast: the label color was 4.0 on cream, now 5.6 (light theme only) */
:root{--lab:#6f6140}
.ed-brand small,.ed-fg .ed-brand small,html[dir=rtl] .ed-brand small{color:#7a5a14!important;font-size:10px}
html[data-theme=dark] .ed-brand small,html[data-theme=dark] .ed-fg .ed-brand small{color:#d9b25a!important}
.st span{color:#7a5a14}
html[data-theme=dark] .st span{color:#d9b25a}
/* focus: every link, button and field shows a ring for keyboard users */
a:focus-visible,button:focus-visible,summary:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--gold);outline-offset:2px;border-radius:4px}
.top .tr a:focus-visible,nav a:focus-visible,.ft2 a:focus-visible{outline:2px solid #d9b25a;outline-offset:2px}
/* tap targets: 44px minimum for header strip, burger, footer links, buttons, fields */
.top .tr a{display:inline-flex;align-items:center;min-height:44px;min-width:44px;justify-content:center;padding-inline:10px}
.top .tr{gap:8px}
.burger,.ed-burger{min-height:44px;min-width:44px}
summary{min-height:44px;display:flex;align-items:center}
.btn,.tabsb button,.tabsb a,.rtabs a,.gtile{min-height:44px}
input:not([type=checkbox]):not([type=radio]):not([type=range]),select{min-height:44px}
@media(max-width:820px){
  .btn{height:auto;min-height:44px}
  .hs button,#hs button,.search button{min-width:44px;min-height:44px}
  .nav nav a,nav a{min-height:44px;display:flex;align-items:center}
  a#fg{display:inline-flex;align-items:center;min-height:44px}
  summary{min-width:44px;justify-content:center}
  .ft2 .fg>div,.ed-fg>div{display:flex;flex-direction:column;align-items:flex-start}
  .ft2 .fg>div>a,.ed-fg>div>a{display:flex;align-items:center;min-height:44px;margin-bottom:0}
}



#app:focus{outline:none}
.skip{position:absolute;inset-inline-start:8px;top:-80px;z-index:999;background:#0b2250;color:#fff;padding:14px 16px;min-height:44px;border-radius:6px;font:600 14px Inter,system-ui,sans-serif;display:inline-flex;align-items:center}
.skip:focus{top:8px}
html[data-theme=dark] .skip{background:#d9b25a;color:#10151f}
/* settings tab: active tab in dark theme had gold text on a light background (contrast 1.7) */
html[data-theme=dark] .snav button.on{background:#d9b25a;color:#10151f;border-color:#d9b25a}
/* "?" help details: long text no longer pushes the page wider than the screen */
details.why{display:block;max-width:100%}
details.why p{max-width:100%;white-space:normal;overflow-wrap:anywhere}
details.why summary{width:44px;height:44px}
/* small controls: 44px targets */
button.fv{min-width:44px;min-height:44px}
.btn.sm,.btn.n.sm{min-height:44px!important;height:auto!important}
.btn.n,.btn.g,.btn.o{min-height:44px}
#efa button,.avg button{min-width:44px;min-height:44px}
/* long unbroken names or text in chat bubbles must wrap, not widen the page */
.cm{min-width:0;overflow-wrap:anywhere}
.cm b,.cm .t{overflow-wrap:anywhere;word-break:break-word}

/* menu items: hover, keyboard focus and current page keep readable text (WCAG AA, 4.5:1) in both themes */
.dd > ul li a:hover,.dd > ul li a:focus-visible,.dd > ul li a.on,.dd > ul li a[aria-current]{background:#f4eee0;color:#0b2250}
html[data-theme=dark] .dd > ul li a:hover,html[data-theme=dark] .dd > ul li a:focus-visible,html[data-theme=dark] .dd > ul li a.on,html[data-theme=dark] .dd > ul li a[aria-current],
html[data-theme=dark] .ed-nav .dd > ul li a:hover,html[data-theme=dark] nav#nav .dd > ul li a:hover,html[data-theme=dark] .ed-nav .dd > ul li a.on,html[data-theme=dark] nav#nav .dd > ul li a.on{background:#d9b25a;color:#10151f}

/* lesson action buttons (save, mark done, report): one size, weight and padding */
.row > #sa,.row > #dn,.row > #rp2{font-size:14px;font-weight:600;padding:0 20px;min-height:44px;height:auto;line-height:1.2;letter-spacing:0;text-transform:none}
/* grammar term popover (replaces the jump to the glossary page) */
button.gl{font:inherit;color:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:3px;text-decoration-color:#b08a2e;font-weight:600}
button.gl:focus-visible{outline:2px solid #b08a2e;outline-offset:2px;border-radius:3px}
html[data-theme=dark] button.gl{text-decoration-color:#e0bd63}
.glpop{position:fixed;z-index:300;box-sizing:border-box;background:#fff;color:#0b2250;border:2px solid #b08a2e;border-radius:14px;padding:16px 18px;box-shadow:0 10px 30px rgba(0,0,0,.35);font-size:16px;line-height:1.75;font-weight:400}
.glpop:focus{outline:none}
.glpop .glh{display:flex;align-items:center;justify-content:space-between;gap:8px}
.glpop .glh b{font-size:18px}
.glpop .glx{min-width:44px;min-height:44px;margin:-14px -14px -14px 0;background:none;border:0;color:inherit;font-size:24px;cursor:pointer;border-radius:8px}
.glpop .glx:focus-visible{outline:2px solid #b08a2e}
.glpop p{margin:6px 0 0}
.glpop small{opacity:.8;font-weight:600}
html[dir=rtl] .glpop .glx{margin:-14px 0 -14px -14px}
.glpop .gld{font-size:16px}
.glpop .gle{font-size:15px}
html[data-theme=dark] .glpop{background:#1b2436;color:#f1ead6;border-color:#d9b25a}
.glpop mark{background:#f4e3b0;color:#0b2250;border-radius:3px;padding:0 3px;font-weight:700}
html[data-theme=dark] .glpop mark{background:#d9b25a;color:#10151f}
/* main navigation (nav.js): top icon bar on desktop, bottom tab bar on phone */
body.xon{--xbg:#fff;--xtx:#0b2250;--xmut:#4a5670;--xline:#e2dccb;--xact:#0b2250;--xcard:#fff;--xhov:#f4eee0;--xchip:#eaf0fa;--xgold:#7a5c14;--xpage:#fbf8f0}
html[data-theme=dark] body.xon{--xbg:#151c2b;--xtx:#f1ead6;--xmut:#aab3c5;--xline:#2a3347;--xact:#d9b25a;--xcard:#1b2436;--xhov:#232d44;--xchip:#232d44;--xgold:#d9b25a;--xpage:#10151f}
body.xon .top,body.xon header.nav,body.xon .ed-top,body.xon header.ed-head{display:none!important}
.xnav,.xpanel,.xbot{font-family:Inter,"Noto Naskh Arabic",Arial,sans-serif;font-size:15px;line-height:1.5}
.xnav svg,.xpanel svg,.xbot svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.xnav{position:sticky;top:0;z-index:150;height:56px;background:var(--xbg);border-bottom:1px solid var(--xline);display:flex;align-items:center;gap:12px;padding:0 16px;color:var(--xtx)}
.xbrand{display:flex;align-items:center;gap:10px;color:var(--xtx);text-decoration:none;font:700 20px "Playfair Display",Georgia,serif;letter-spacing:.04em}
html[dir=rtl] .xbrand{letter-spacing:0;font-family:"Noto Naskh Arabic",serif}
.xbrand img{width:40px;height:40px;object-fit:contain}
.xsrch{display:flex;align-items:center;gap:8px;background:var(--xchip);border-radius:22px;height:40px;padding:0 14px;color:var(--xmut);width:210px}
.xsrch svg{width:18px;height:18px}.xsrch input{flex:1;min-width:0;background:none;border:0;outline:0;color:var(--xtx);font:inherit;height:38px}
.xtabs{position:absolute;inset-inline:0;margin:auto;width:max-content;display:flex;height:56px}
.xtab{width:84px;height:56px;display:flex;align-items:center;justify-content:center;color:var(--xmut);position:relative;border-radius:8px;text-decoration:none}
.xtab:hover{background:var(--xhov)}.xtab.on{color:var(--xact)}.xtab.on:after{content:"";position:absolute;inset-inline:6px;bottom:0;height:3px;background:var(--xact);border-radius:3px 3px 0 0}
.xedge{margin-inline-start:auto;display:flex;gap:8px;align-items:center}
.xib{width:44px;height:44px;border-radius:50%;background:var(--xchip);display:flex;align-items:center;justify-content:center;color:var(--xtx);border:0;cursor:pointer;text-decoration:none;padding:0}
.xib:hover{background:var(--xhov)}.xmenu[aria-expanded=true]{background:var(--xact);color:var(--xpage)}
.xnav a:focus-visible,.xnav button:focus-visible,.xpanel a:focus-visible,.xpanel button:focus-visible,.xbot a:focus-visible{outline:3px solid #b08a2e;outline-offset:2px}
#xsb{display:none}
.xpanel{position:fixed;top:60px;inset-inline-end:16px;width:min(820px,calc(100vw - 32px));max-height:calc(100vh - 76px);overflow:auto;background:var(--xcard);color:var(--xtx);border:1px solid var(--xline);border-radius:14px;box-shadow:0 12px 40px rgba(0,0,0,.35);z-index:160;display:flex;gap:16px;padding:16px}
.xpanel[hidden]{display:none}
.xmain{flex:1;min-width:0}.xside{width:230px;background:var(--xpage);border-radius:12px;padding:12px;align-self:flex-start;flex:none}
.xpanel h2{margin:0;font-size:22px;color:var(--xtx)}.xh{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.xclose{display:none}
.xpanel h3{margin:14px 0 6px;font-size:16px;color:var(--xgold);font-weight:700}.xside h3{margin-top:0;color:var(--xtx);font-size:18px}
.xg{display:grid;grid-template-columns:1fr 1fr;column-gap:12px}.xg h3{grid-column:1/-1}
.xent,.xq{display:flex;gap:12px;align-items:flex-start;padding:8px;border-radius:10px;min-height:44px;color:var(--xtx);text-decoration:none}
.xq{align-items:center;font-weight:600}.xent:hover,.xq:hover{background:var(--xhov)}
.xico{width:40px;height:40px;border-radius:10px;background:#0f295f;color:#d9b25a;display:flex;align-items:center;justify-content:center;flex:none}.xq .xico{width:36px;height:36px;border-radius:50%}
.xent b{display:block;font-size:15px}.xent small{display:block;color:var(--xmut);font-size:13px;line-height:1.4}
.xbot{display:none}
@media(max-width:900px){.xsrch{display:none}.xtabs{display:none}#xsb{display:flex}
 .xnav{padding:0 10px;gap:8px}.xbrand{font-size:18px}
 .xbot{display:flex;position:sticky;bottom:0;margin-top:auto;width:100%;min-height:calc(62px + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px);box-sizing:border-box;background:var(--xbg);border-top:1px solid var(--xline);z-index:155}
 .xbt{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px;color:var(--xmut);text-decoration:none;position:relative;min-width:44px}
 .xbt.on{color:var(--xact)}.xbt.on:before{content:"";position:absolute;top:0;inset-inline:14px;height:3px;background:var(--xact);border-radius:0 0 3px 3px}
 body.xon{display:flex;flex-direction:column;min-height:100vh;min-height:100dvh}
 body.xon>*{min-width:0}
 body.xon>.pg{width:100%}
 .xpanel{inset:56px 0 calc(62px + env(safe-area-inset-bottom,0px)) 0;width:auto;max-height:none;border-radius:0;border:0;flex-direction:column;padding:12px 12px 20px;box-shadow:none}
 .xside{width:auto;order:-1;display:flex;gap:8px;overflow-x:auto;padding:8px;flex:none;align-self:stretch}.xside h3{display:none}
 .xq{background:var(--xcard);border:1px solid var(--xline);border-radius:22px;white-space:nowrap;padding:4px 12px 4px 4px;flex:none}
 .xg{grid-template-columns:1fr}.xent{min-height:56px;padding:10px 8px}.xclose{display:flex}
 body.xopen{overflow:hidden}}
.xbrand{min-height:44px}
@media(max-width:380px){.xnav{padding:0 6px;gap:6px}.xedge{gap:4px}.xbrand{gap:6px;font-size:17px}.xbrand img{width:36px;height:36px}}
@media(max-width:380px){.g2.cmp>*{min-width:0;max-width:100%;box-sizing:border-box;overflow-wrap:anywhere}a.qa{max-width:100%;box-sizing:border-box}}
@media(max-width:380px){.qa-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.qa{min-width:0;padding:12px}}
.xsrch input::placeholder{color:var(--xmut);opacity:1}
/* sound check panel (settings) */
#scOut{margin-top:12px}
.scr{margin:6px 0;font-size:14px;word-break:break-word}
.scl{list-style:none;margin:6px 0;padding:0;font-size:13px;max-height:170px;overflow:auto}
.scl li{padding:4px 0;border-bottom:1px solid var(--line,#e7e0d0)}
.scv{margin:10px 0 0;padding:10px 12px;border-inline-start:4px solid var(--gold);border-radius:8px;background:var(--cream,#fbf8f2)}
html[data-theme=dark] .scv{background:#1a2236}
html[data-theme=dark] .scl li{border-bottom-color:#2a3347}
.scv #scSwap{display:block;width:fit-content;margin-top:10px}

/* dashboard polish: progress grid never 3+1, welcome card spacing, certificate links */
.pgrid{grid-template-columns:repeat(4,1fr)}
@media(max-width:900px){.pgrid{grid-template-columns:repeat(2,1fr)}}
#welc{margin-bottom:18px}
#welc + h1:before{display:none}
.certs{gap:10px}
.certs .btn{flex:1 1 96px;justify-content:center;text-align:center;padding:0 8px;white-space:nowrap}
.certs+.hint{margin-top:12px}
/* global gap between a text block and the action row/button right after it */
.pg p + .row,.panel p + .row,.pg p + .btn,.panel p + .btn{margin-top:14px}
.panel p + p:has(> .btn:only-child){margin-top:14px}

/* offline preview card for server-only pages: faint layout skeleton */
.svoff h2{margin-top:0}
.skl{display:flex;flex-direction:column;gap:10px;margin:2px auto 18px;max-width:420px;pointer-events:none}
.skl i{display:block;height:13px;border-radius:7px;background:currentColor;opacity:.13}
.skl i:first-child{height:64px;border-radius:14px;opacity:.09}
.skl i:nth-child(2){width:82%}
.skl i:nth-child(3){width:64%}
.skl i:nth-child(4){width:38%}

/* two-tab switcher: short one-line labels, equal size */
.rtabs a{white-space:nowrap;display:inline-flex;align-items:center;justify-content:center}
/* stat card bars: clear inner margin so the track never nears the card border */
.panel.stat .bar{margin-inline:5px}
/* buttons: true vertical centering and clean wrapping for long labels */
.btn{height:auto;min-height:48px;padding-block:10px;line-height:1.3;text-align:center}
.btn.sm{height:auto;min-height:38px;padding-block:8px}
.btn.cont{display:inline-flex;align-items:center;justify-content:center}
.btn.n{height:auto;min-height:44px}
.btn.r{height:auto;min-height:34px}
#fl .kbtn,#fl #cn,#fl #go,#fl #tk2{height:auto;min-height:46px}
/* Header: search collapses to an icon before it can touch the centered tabs (tabs are 6x84px, viewport-centered; full 210px field only fits with clearance at >=1250px). The icon toggles the same wrap-open full-width search row as on phones. */
.xnav.xs-open{height:auto;flex-wrap:wrap;padding-bottom:8px}
.xnav.xs-open .xsrch{display:flex;order:5;width:100%}
@media (min-width:901px) and (max-width:1249px){
 .xsrch{display:none}
 #xsb{display:flex}
 .xtab{width:72px}
 .xnav.xs-open .xtabs{display:none}
}

/* Third audit UX-02, UX-12: online-only mark in the bars and menu, and short labels on wide screens */
.xic{position:relative;display:flex;align-items:center;justify-content:center;flex:none}
.xdot{position:absolute;top:-6px;inset-inline-end:-10px;width:10px;height:10px;border-radius:50%;background:transparent;color:var(--xgold);display:flex;align-items:center;justify-content:center;font-style:normal;line-height:0}.xdot svg{display:block}
.xol{display:inline-block;margin-inline-start:6px;padding:0 7px;border:1px solid var(--xgold);border-radius:20px;color:var(--xgold);font:600 10px/1.7 Inter,"Noto Naskh Arabic",Arial,sans-serif;letter-spacing:.04em;vertical-align:middle;white-space:nowrap;font-style:normal}
.xtab .xlab{display:none}
@media(min-width:1200px){
 .xtab{width:auto;padding:0 13px;gap:9px}
 .xtab .xlab{display:inline;font-size:13.5px;font-weight:600;white-space:nowrap}
}
@media(max-width:1000px){.qa-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.qa{min-width:0;flex-wrap:wrap;row-gap:4px}.qa-tag{margin-inline-start:0}}
@media(max-width:480px){.xbot .xbt{font-size:9.5px;min-width:0;padding-inline:0;letter-spacing:-.2px}.xbot .xbt span{white-space:nowrap}}@media(max-width:340px){.xbot .xbt{font-size:8.5px}}.xdot svg{width:10px!important;height:10px!important;max-width:none}
html[data-theme=dark] #fl .kcard .kar,html[data-theme=dark] #fl .kcard .kar b,html[data-theme=dark] #fl .kcard p[dir=rtl]{color:#efd79c!important}

/* Terms-lesson polish */
.nomic #rcBar{display:none!important}
.item .pill{float:none!important;display:inline-block;margin:0 0 6px!important}
.item h4{clear:both}
#fl .kar{font-size:16px!important;padding:8px 12px!important;line-height:1.6;margin:10px auto!important;max-width:340px}
.nomic #micbox{display:none!important}

/* Owner announcement banner + ad slots (migration 30). Reads well on light and dark. */
.kil-ann{display:flex;align-items:center;justify-content:center;gap:12px;background:#0f295f;color:#fff;padding:10px 44px;text-align:center;position:relative;font-size:15px;line-height:1.5}
.kil-ann .x{position:absolute;inset-inline-end:12px;top:50%;transform:translateY(-50%);background:none;border:0;color:#fff;font-size:22px;line-height:1;cursor:pointer;padding:4px}
.kil-ad{margin:20px auto 8px;max-width:728px;text-align:center}
.kil-ad-box{border:1.5px dashed #b8ad8f;border-radius:12px;padding:26px 12px;color:#8a7a52;background:rgba(138,122,82,.06)}
.kil-ad-box small{letter-spacing:2px;text-transform:uppercase;font-size:11px}
.kil-adwrap{padding:0 16px;box-sizing:border-box}
/* Text scaling: enlarge reading and form copy without scaling fixed navigation chrome. */
html[data-text-scale="1.15"] main :is(p,li,label,td,input,textarea,.hint,.kar,.race-meaning){font-size:20px!important;line-height:1.6!important}html[data-text-scale="1.3"] main :is(p,li,label,td,input,textarea,.hint,.kar,.race-meaning){font-size:23px!important;line-height:1.65!important}html[data-text-scale="1.3"] main :is(h1,h2,h3,h4){line-height:1.4!important;overflow-wrap:anywhere}main input,main textarea{box-sizing:border-box;max-width:100%}#studyBackup{overflow-wrap:anywhere}#studyBackup input{max-width:100%}

#sSize{direction:ltr}

/* ---- spacing pass: one scale (4/8/12/16/24/32), 44px targets on chat controls, one card radius ---- */
:root{--s1:4px;--s2:8px;--s3:12px;--s4:16px;--s5:24px;--s6:32px}
.cm{border-radius:var(--r,18px);padding:var(--s3) var(--s4);max-width:100%}
.chatlog{gap:var(--s3)}
.rbar{display:flex;flex-wrap:nowrap;gap:0;margin-top:var(--s2);justify-content:space-between;max-width:288px}
.rbar .re{flex:1 1 0;min-width:40px;min-height:44px;padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:17px;line-height:1;border-radius:var(--s3)}
.macts{display:flex;align-items:center;gap:var(--s2);margin-top:var(--s1)}
.macts .rrp,.cm .rpt{min-height:44px;min-width:44px;padding:0 var(--s3);display:inline-flex;align-items:center;justify-content:center;font-size:14px;border-radius:var(--s3)}
.cm .rpt{font-size:18px}
.ft2{margin-top:var(--s6)}
.wchip.bot{background:#e8f0ff;border-style:dashed}
html[data-theme=dark] .wchip.bot{background:#14233f;border-style:dashed}
.trbox{margin:6px 0 2px;padding:8px 10px;border-radius:12px;border:1px dashed var(--line,#445);font-size:14px}.trbox[hidden]{display:none}
.macts .rrp{background:none;border:1px solid var(--line,#dfe4ee);color:inherit;border-radius:12px}
.macts .rrp[aria-pressed=true]{border-color:#c9a227;color:#c9a227}
.trbox{color:inherit;background:rgba(127,127,127,.06)}
.trbox small{display:block;margin-top:4px;opacity:.75}
.trbox .btn{margin-top:8px}
