/* KhanAtlas shared shell contract: preserves approved homepage structure. */
:root{--ka-shell-logo-width:138px;--ka-shell-focus:#b78c55}
html[lang=ar] body{font-family:Tajawal,Arial,sans-serif}
html[lang=ar] :is(h1,h2,h3,h4){font-family:Cairo,Tajawal,Arial,sans-serif}
html[lang=en] body{font-family:Inter,Arial,sans-serif}
header .brand-logo{display:block;width:var(--ka-shell-logo-width);height:auto;max-height:92px;object-fit:contain}
header .brand{display:inline-flex;align-items:center;flex:0 0 auto;min-width:0}
header nav{min-width:0}
header nav :is(a,button,summary):focus-visible,footer a:focus-visible{outline:3px solid var(--ka-shell-focus);outline-offset:3px}
footer a{text-underline-offset:4px}
footer a:hover{text-decoration:underline}
footer .brand-logo{width:138px;height:auto;max-height:92px;object-fit:contain}
.ka-shared-footer{padding:26px 0;background:#10283b;color:#f4f7f9;font-family:inherit}
.ka-shared-footer .ka-footer-inner{width:min(1120px,calc(100% - 32px));margin-inline:auto;display:flex;align-items:flex-start;justify-content:space-between;gap:24px;flex-wrap:wrap}
.ka-shared-footer .ka-footer-brand{display:flex;align-items:center;gap:14px}
.ka-shared-footer .ka-footer-brand img{display:block;width:120px;height:auto;max-height:80px;object-fit:contain}
.ka-shared-footer .ka-footer-links{display:flex;flex-wrap:wrap;gap:12px 22px;align-items:center}
.ka-shared-footer a{color:#f4f7f9;text-decoration:none}
.ka-shared-footer small{color:#cbd5df;line-height:1.6}
@media(max-width:720px){:root{--ka-shell-logo-width:112px}.ka-shared-footer .ka-footer-inner{flex-direction:column;gap:16px}.ka-shared-footer .ka-footer-links{gap:10px 18px}}

/* Scoped header stability: preserve link wrapping while keeping preferences reachable. */
header .ka-shared-toolbar{flex-shrink:0}
header .ka-shared-toolbar .ux-locale-panel{font-size:15px;letter-spacing:normal}
header .ka-shared-toolbar .ux-locale-panel nav{min-height:0}
header .ka-shared-toolbar .ux-locale-panel nav a{opacity:1}
header .ka-shared-toolbar .ux-locale-panel nav a:hover{text-decoration:underline}
header .ka-shared-toolbar .ux-mode{font-family:Arial,sans-serif}
@media(max-width:900px){header .wrap.nav{flex-wrap:wrap;padding-block:8px}header .wrap.nav>.links{flex-wrap:wrap}header .wrap.nav>.ka-shared-toolbar{margin-inline-start:auto}}
@media(max-width:620px){header .wrap.nav{gap:8px}header .wrap.nav>.links{order:3;width:100%;justify-content:center}header .wrap.nav>.ka-shared-toolbar{order:2}header .wrap.nav>.brand{order:1}header .ka-shared-toolbar{gap:4px}}

/* Exchange: mobile contract data remains a horizontally scrollable table with an obvious cue. */
@media(max-width:620px){
 html:has(.table-wrap) .table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin;border-radius:14px}
 html:has(.table-wrap) .table-wrap table{min-width:760px}
 html:has(.table-wrap) .table-wrap th,html:has(.table-wrap) .table-wrap td{padding-inline:12px;white-space:nowrap}
 html:has(.table-wrap) .ka-shared-footer{padding-block:24px}
 html:has(.table-wrap) .ka-shared-footer .ka-footer-inner{gap:20px}
 html:has(.table-wrap) .ka-shared-footer .ka-footer-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:12px 18px}
 html:has(.table-wrap) .ka-shared-footer .ka-footer-links a{font-size:14px;line-height:1.55;min-height:30px}
 html:has(.table-wrap) .ka-shared-footer small{font-size:13px;line-height:1.8}
}

/* Shared footer layout: explicit blocks prevent inline text collisions in compact Exchange pages. */
.ka-shared-footer .ka-footer-inner>div:first-child{display:flex;flex-direction:column;align-items:flex-start;gap:12px;min-width:0;max-width:360px}
.ka-shared-footer .ka-footer-brand{display:inline-flex;align-items:center;max-width:100%}
.ka-shared-footer .ka-footer-inner>div:first-child small{display:block}
.ka-shared-footer .ka-footer-links{display:flex;align-items:flex-start;justify-content:flex-start;gap:12px 22px;min-width:0}
.ka-shared-footer .ka-footer-links a{display:inline-block;white-space:normal;line-height:1.5}
.ka-shared-footer .ka-footer-inner>small{display:block;flex-basis:100%}
@media(max-width:620px){
 .ka-shared-footer .ka-footer-inner{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:18px!important}
 .ka-shared-footer .ka-footer-inner>div:first-child{width:100%;max-width:none}
 .ka-shared-footer .ka-footer-links{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:12px 16px!important}
 .ka-shared-footer .ka-footer-links a{display:block;font-size:14px;min-height:32px}
 .ka-shared-footer .ka-footer-inner small{font-size:13px;line-height:1.7}
}

.ka-table-scroll-hint{display:none;margin:0 0 10px;color:#52687d;font-size:13px;line-height:1.5}
@media(max-width:620px){.ka-table-scroll-hint{display:block}}

/* Visible wordmark fallback for transparent logos on dark footer surfaces. */
.ka-shared-footer .ka-footer-brand{display:inline-flex;align-items:center;gap:12px;text-decoration:none}
.ka-shared-footer .ka-footer-wordmark{color:#fff;font-family:Inter,Tajawal,Arial,sans-serif;font-size:20px;font-weight:750;letter-spacing:.015em;line-height:1.3}
@media(max-width:620px){.ka-shared-footer .ka-footer-wordmark{font-size:19px}}
