/* Malichuspedia app layer: bottom bar, sheets, favorites, today, nearby stores */
:root{--af-terra:#A34E37;--af-terra-d:#7f3a28;--af-paper:#FAF5E0;--af-cream:#F1EADB;--af-ink:#120d0b;--af-mut:#6d5d52;--af-line:#e2d6bd;--af-bar:64px}
body{padding-bottom:calc(var(--af-bar) + env(safe-area-inset-bottom))!important}
#mz-offline{bottom:calc(var(--af-bar) + 14px + env(safe-area-inset-bottom))!important}
#af-bar{box-sizing:border-box;position:fixed;left:0;right:0;bottom:0;z-index:10040;display:flex;background:rgba(250,245,224,.97);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-top:1px solid var(--af-line);padding:0 4px env(safe-area-inset-bottom);direction:rtl;height:calc(var(--af-bar) + env(safe-area-inset-bottom))}
#af-bar button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;background:none;border:0;color:var(--af-mut);font:600 11.5px/1.1 "Noto Naskh Arabic",Lora,serif;padding:6px 2px;cursor:pointer;position:relative;-webkit-tap-highlight-color:transparent}
#af-bar button svg{width:23px;height:23px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#af-bar button[aria-selected=true]{color:var(--af-terra)}
#af-bar button[aria-selected=true] svg{stroke-width:2.1}
#af-bar button:focus-visible,#af-sheet button:focus-visible,#af-fav:focus-visible,#af-sheet a:focus-visible,#af-sheet input:focus-visible,#af-sheet select:focus-visible{outline:2px solid var(--af-terra);outline-offset:2px;border-radius:8px}
#af-bar .af-dot{position:absolute;top:7px;inset-inline-start:calc(50% + 6px);width:9px;height:9px;border-radius:50%;background:var(--af-terra);border:2px solid var(--af-paper)}
#af-sheet{position:fixed;left:0;right:0;top:0;bottom:calc(var(--af-bar) + env(safe-area-inset-bottom));z-index:8000;background:var(--af-paper);display:flex;flex-direction:column;direction:rtl;font-family:"Noto Naskh Arabic",Lora,serif;color:var(--af-ink);transform:translateY(0);animation:af-in .22s ease-out}
#af-sheet[hidden]{display:none}
@keyframes af-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){#af-sheet{animation:none}}
#af-sheet header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:calc(14px + env(safe-area-inset-top)) 18px 12px;border-bottom:1px solid var(--af-line)}
#af-sheet h1{margin:0;font:700 24px/1.2 "Noto Naskh Arabic",Lora,serif;color:var(--af-terra)}
#af-sheet .af-x{background:var(--af-cream);border:0;border-radius:50%;width:38px;height:38px;font-size:20px;line-height:1;color:var(--af-ink);cursor:pointer}
#af-sheet .af-body{flex:1;overflow:auto;padding:16px 18px 28px;-webkit-overflow-scrolling:touch}
#af-sheet[data-lang=en]{direction:ltr}#af-sheet[data-lang=en] header{direction:ltr}
.af-card{background:#fffdf5;border:1px solid var(--af-line);border-radius:18px;padding:18px;margin:0 0 14px;box-shadow:0 6px 18px rgba(80,40,20,.06)}
.af-day{background:linear-gradient(160deg,#B4573F,#8c3f2b);color:#FAF5E0;border:0;padding:22px 20px}
.af-day h2{margin:6px 0 4px;font:700 28px/1.3 "Noto Naskh Arabic",Lora,serif}
.af-day .af-sub{margin:0 0 10px;color:#f1d9ce;font-size:15px}
.af-day .af-hook{margin:0 0 18px;font-size:18px;line-height:1.75}
.af-meta{margin:0;font-size:13.5px;color:var(--af-mut)}.af-day .af-meta{color:#f1d9ce}
.af-chip{display:inline-block;background:var(--af-cream);color:var(--af-terra-d);border-radius:20px;padding:2px 11px;font:600 12.5px/1.6 "Noto Naskh Arabic",Lora,serif}
.af-day .af-chip{background:rgba(250,245,224,.18);color:#FAF5E0}
.af-btns{display:flex;gap:10px;flex-wrap:wrap}
.af-primary,.af-ghost,.af-link{font:700 15.5px/1 "Noto Naskh Arabic",Lora,serif;border-radius:30px;padding:12px 20px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;box-sizing:border-box}
.af-primary{background:var(--af-terra);color:#FAF5E0;border:0}
.af-day .af-primary{background:#FAF5E0;color:var(--af-terra-d)}
.af-ghost,.af-link{background:transparent;color:var(--af-terra);border:1.5px solid var(--af-terra)}
.af-day .af-ghost{color:#FAF5E0;border-color:rgba(250,245,224,.6)}
.af-search{width:100%;box-sizing:border-box;font:500 17px "Noto Naskh Arabic",Lora,serif;padding:14px 16px;border-radius:14px;border:1.5px solid var(--af-line);background:#fffdf5;color:var(--af-ink)}
.af-list{list-style:none;margin:12px 0 0;padding:0}
.af-item{display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--af-line);padding:12px 2px}
.af-item>button.af-open{all:unset;cursor:pointer;flex:1;min-width:0;display:block;padding:2px}
.af-item b{display:block;font:700 17px/1.4 "Noto Naskh Arabic",Lora,serif}
.af-item small{display:block;color:var(--af-mut);font-size:13.5px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.af-rm{background:none;border:0;color:var(--af-mut);font-size:20px;cursor:pointer;padding:8px;min-width:44px;min-height:44px}
.af-empty{text-align:center;color:var(--af-mut);padding:38px 12px;font-size:17px;line-height:1.9}
.af-empty svg{width:46px;height:46px;stroke:var(--af-terra);fill:none;stroke-width:1.4;margin-bottom:8px}
.af-note{font-size:13px;color:var(--af-mut);line-height:1.8;margin:14px 0 0}
.af-store h3{margin:6px 0 2px;font:700 19px/1.4 "Noto Naskh Arabic",Lora,serif}
.af-store .af-meta{margin-bottom:12px}
.af-dist{float:inline-end;font:700 14px Lora,serif;color:var(--af-terra)}
.af-row{display:flex;gap:8px;align-items:center;margin:0 0 12px;flex-wrap:wrap}
.af-sel{font:500 15px "Noto Naskh Arabic",Lora,serif;padding:10px 12px;border-radius:12px;border:1.5px solid var(--af-line);background:#fffdf5;color:var(--af-ink);max-width:100%}
#af-fav{position:fixed;z-index:10050;right:14px;left:auto;bottom:calc(var(--af-bar) + 16px + env(safe-area-inset-bottom));display:none;align-items:center;justify-content:center;width:52px;height:52px;background:var(--af-ink);color:#FAF5E0;border:0;border-radius:50%;box-shadow:0 8px 22px rgba(0,0,0,.3);cursor:pointer;padding:0}
#af-fav.on{display:flex}
#af-fav svg{width:24px;height:24px;stroke:#FAF5E0;fill:none;stroke-width:2}
#af-fav[aria-pressed=true] svg{fill:#E58B6F;stroke:#E58B6F}
.af-toast{position:fixed;z-index:10060;left:50%;transform:translateX(-50%);bottom:calc(var(--af-bar) + 74px + env(safe-area-inset-bottom));background:var(--af-ink);color:#FAF5E0;border-radius:24px;padding:9px 18px;font:600 14px "Noto Naskh Arabic",Lora,serif;opacity:0;transition:opacity .25s;pointer-events:none;white-space:nowrap}
.af-toast.on{opacity:1}

/* keep the encyclopedia's full-screen reader above the bar, not under it */
#mz-modal{bottom:calc(var(--af-bar) + env(safe-area-inset-bottom))!important}

/* encyclopedia only: hide the store strip before scripts remove it */
.mz-shop,#mz section[aria-label="من ماليكس"],#mz section[aria-label="From Malichus"]{display:none!important}

.mz-up{bottom:calc(var(--af-bar) + 16px + env(safe-area-inset-bottom))!important}
.af-noimg{margin:10px auto;padding:14px 16px;border:1px dashed var(--af-line);border-radius:12px;color:var(--af-mut);font:600 14px "Noto Naskh Arabic",Lora,serif;text-align:center;background:rgba(241,234,219,.5)}
.af-h{display:block;font:700 18px/1.4 "Noto Naskh Arabic",Lora,serif;margin-bottom:4px}
[data-offline] progress{width:100%;height:10px;margin:6px 0 0;accent-color:var(--af-terra)}

/* timeline on phones: keep cards above/below the line, but overlap neighbours so two cards are always in view */
@media(max-width:560px){
#mz .th-item{width:250px;margin-inline-start:-110px}
#mz .th-item:first-of-type,#mz .th-era+.th-item{margin-inline-start:8px}
#mz .th-track{min-height:600px}
}
/* offline pictures prompt */
#af-dlbar{position:fixed;left:12px;right:12px;z-index:10045;bottom:calc(var(--af-bar) + env(safe-area-inset-bottom) + 12px);direction:rtl;font-family:"Noto Naskh Arabic",Lora,serif}
#af-dlbar .af-card{margin:0;box-shadow:0 10px 30px rgba(0,0,0,.25)}
#af-dlbar .af-meta{margin:6px 0 10px;font-size:14px;line-height:1.7}
#af-sheet [hidden],#af-dlbar [hidden]{display:none!important}
.af-updbar{position:fixed;left:12px;right:12px;z-index:10070;top:calc(env(safe-area-inset-top) + 8px);display:flex;align-items:center;justify-content:space-between;gap:12px;direction:rtl;background:#120d0b;color:#FAF5E0;border-radius:16px;padding:10px 14px;font:600 14.5px "Noto Naskh Arabic",Lora,serif;box-shadow:0 10px 30px rgba(0,0,0,.35)}
.af-updbar button{background:#A34E37;color:#FAF5E0;border:0;border-radius:20px;padding:8px 18px;font:700 14px inherit;font-family:inherit;cursor:pointer}
.af-form{display:flex;flex-direction:column;gap:12px}
.af-lbl{display:flex;flex-direction:column;gap:6px;font:600 14.5px "Noto Naskh Arabic",Lora,serif;color:var(--af-ink)}
.af-in{font:500 16px "Noto Naskh Arabic",Lora,serif;padding:12px 14px;border-radius:12px;border:1.5px solid var(--af-line);background:#fffdf5;color:var(--af-ink);width:100%;box-sizing:border-box}
.af-form .af-sel{width:100%;box-sizing:border-box;font-size:16px}
.af-chk{display:flex;align-items:center;gap:10px;font:500 14.5px "Noto Naskh Arabic",Lora,serif}
.af-chk input{width:20px;height:20px;accent-color:var(--af-terra)}
.af-hp{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}
button.af-link{background:none;cursor:pointer}
.mz-audit-language-note{display:none!important}

/* assistant */
.af-msg{max-width:88%;padding:11px 14px;border-radius:16px;margin:0 0 10px;font:500 15.5px/1.75 "Noto Naskh Arabic",Lora,serif;overflow-wrap:anywhere}
.af-me{background:var(--af-terra);color:#FAF5E0;margin-inline-end:auto;border-end-start-radius:4px}
.af-bot{margin-inline-start:auto;background:#fffdf5;border:1px solid var(--af-line);color:var(--af-ink);border-end-end-radius:4px}
.af-bot p{margin:0 0 8px}
.af-bot .af-list{margin:6px 0 8px}
.af-typing{color:var(--af-mut)}
.af-chips{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0 14px}
.af-chip2{font:600 14px "Noto Naskh Arabic",Lora,serif;border:1.5px solid var(--af-line);background:#fffdf5;color:var(--af-terra-d);border-radius:20px;padding:9px 14px;cursor:pointer}
.af-chips[hidden]{display:none}
.af-askform{display:flex;gap:8px;margin:10px 0 4px;position:sticky;bottom:0;background:var(--af-paper);padding:8px 0}
.af-askform .af-in{flex:1;min-width:0}
/* social links */
#af-social{max-width:640px;margin:34px auto 10px;padding:0 18px;text-align:center}
#af-social h2{font:700 1.25em "Noto Naskh Arabic",Lora,serif;margin:0 0 12px;color:#120d0b}
.af-soc{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
.af-soc a{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;color:#A34E37;text-decoration:none;border:1.5px solid #e2d6bd;background:#fffdf5;border-radius:50%}
.af-soc a svg{display:block}
.af-soc a:focus-visible{outline:2px solid #A34E37;outline-offset:2px}

#af-sug{position:fixed;z-index:10050;right:19px;left:auto;bottom:calc(var(--af-bar) + 16px + 52px + 10px + env(safe-area-inset-bottom));display:none;align-items:center;justify-content:center;width:42px;height:42px;background:#fffdf5;color:#7f3a28;border:1.5px solid #e2d6bd;border-radius:50%;box-shadow:0 6px 16px rgba(0,0,0,.18);cursor:pointer;padding:0}
#af-sug.on{display:flex}
#af-sug svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
#af-sug:focus-visible{outline:2px solid #A34E37;outline-offset:2px}
.af-ta{min-height:110px;resize:vertical;line-height:1.7}
.af-in[readonly]{background:#f3ecd9;color:#6d5d52}
.af-news .af-dist{float:inline-end}
#af-newshome{max-width:640px;margin:34px auto 0;padding:0 18px}
#af-newshome h2{font:700 1.25em "Noto Naskh Arabic",Lora,serif;margin:0 0 12px;text-align:center;color:#120d0b}
#af-newshome .af-card{margin:0 0 12px;background:#fffdf5;border:1px solid #e2d6bd;border-radius:18px;padding:16px;font-family:"Noto Naskh Arabic",Lora,serif;color:#120d0b;text-align:start}
#af-newshome .af-card h3{margin:6px 0;font-size:1.1em}
#af-newshome .af-meta{margin:4px 0;font-size:.95em;color:#6d5d52;line-height:1.7}
#af-newshome .af-chip{display:inline-block;font:600 12.5px "Noto Naskh Arabic",Lora,serif;background:#f1e4d8;color:#7f3a28;border-radius:14px;padding:3px 10px}
#af-newshome .af-dist{float:inline-end;font-size:.85em;color:#6d5d52}
#af-newshome .af-btns{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}
#af-newshome .af-primary,#af-newshome .af-ghost{font:700 15px "Noto Naskh Arabic",Lora,serif;border-radius:30px;padding:11px 18px;cursor:pointer;text-decoration:none;display:inline-flex}
#af-newshome .af-primary{background:#A34E37;color:#FAF5E0;border:0}
#af-newshome .af-ghost{background:none;color:#7f3a28;border:1.5px solid #A34E37}
.af-nh-empty{text-align:center;color:#6d5d52;margin:0 0 12px;line-height:1.8}
#af-sheet:not([hidden]) ~ #af-fav,#af-sheet:not([hidden]) ~ #af-sug{display:none!important}

.af-h3{font:700 1.05em "Noto Naskh Arabic",Lora,serif;margin:14px 0 6px;color:#120d0b}
.af-press{display:block;text-decoration:none;margin:0 0 10px;padding:13px 15px;background:#fffdf5;border:1px solid #e2d6bd;border-radius:16px;font-family:"Noto Naskh Arabic",Lora,serif;color:#120d0b;text-align:start}
.af-pr-src{display:block;font-size:.85em;color:#7f3a28;font-weight:600}
.af-pr-t{display:block;margin:4px 0;line-height:1.55;font-weight:600}
.af-pr-go{display:block;font-size:.85em;color:#6d5d52}
#af-newshome .af-h3{margin:22px 0 8px;text-align:center}

#af-pushbar{position:fixed;left:12px;right:12px;z-index:10044;bottom:calc(var(--af-bar) + env(safe-area-inset-bottom) + 12px);direction:rtl;font-family:"Noto Naskh Arabic",Lora,serif}
#af-pushbar .af-card{margin:0;box-shadow:0 10px 30px rgba(0,0,0,.25)}
#af-pushbar .af-meta{margin:6px 0 10px;font-size:14px;line-height:1.7}
.af-pushrow{display:flex;justify-content:center;margin:18px 0 0}
.af-pushrow .af-primary{font:700 15px "Noto Naskh Arabic",Lora,serif;border-radius:30px;padding:11px 18px;cursor:pointer;background:#A34E37;color:#FAF5E0;border:0}
/* language switch must not be squeezed by the brand text in English */
.mz-lang{flex:none}.mz-lang button{padding:2px 11px;white-space:nowrap;font-size:15px}



#af-lang{position:fixed;inset:0;z-index:2147482000;background:var(--paper,#FAF3DF);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:24px max(24px,env(safe-area-inset-left)) calc(24px + env(safe-area-inset-bottom));text-align:center}
#af-lang img{height:67px;width:auto;margin-bottom:6px}
#af-lang h2{margin:0;color:#2B1109;line-height:1.3}
#af-lang h2.ar{font:700 28px/1.3 "Noto Naskh Arabic","Amiri",serif}#af-lang h2.en{font:600 22px/1.3 Lora,Georgia,serif}
.af-lbtns{display:flex;flex-direction:column;gap:12px;width:min(100%,300px);margin-top:14px}
.af-lbtns button{border:2px solid #A04933;background:transparent;color:#A04933;border-radius:16px;padding:14px 16px;min-height:58px;cursor:pointer}
.af-lbtns button.sel{background:#A04933;color:#FAF5E0}
.af-lbtns button.ar{font:700 26px/1.2 "Noto Naskh Arabic","Amiri",serif}.af-lbtns button.en{font:600 22px/1.2 Lora,Georgia,serif}
.af-lbtns button:focus-visible{outline:3px solid #6E2D1E;outline-offset:3px}
#af-lang p{margin:10px 0 0;color:#7A5B4E;font-size:14px;line-height:1.7;display:flex;flex-direction:column;gap:2px}

.mz-brand.af-brand{gap:10px;min-width:0}.mz-brand.af-brand img{height:42px;width:auto;filter:none;mix-blend-mode:normal;flex:none}
.mz-brand.af-brand b{color:var(--terra);font-weight:700;white-space:nowrap}
.mz-brand.af-brand b.ar{font:700 31px/1.2 "Noto Naskh Arabic","Amiri",serif}.mz-brand.af-brand b.en{font:600 25px/1.2 Lora,Georgia,serif}
#mz .mz-top .mz-lang button{padding:0 10px;min-height:30px;height:30px;font-size:14px;line-height:1}
@media (max-width:389px){.mz-brand.af-brand{gap:8px}.mz-brand.af-brand img{height:36px}.mz-brand.af-brand b.ar{font-size:27px}.mz-brand.af-brand b.en{font-size:21px}}
@media (max-width:349px){.mz-brand.af-brand img{height:30px}.mz-brand.af-brand b.ar{font-size:23px}.mz-brand.af-brand b.en{font-size:17px}.mz-brand.af-brand{gap:6px}}
@media (max-width:349px){#mz .mz-top .mz-lang button{padding:0 8px;font-size:13px;height:28px;min-height:28px}}

/* privacy link + in-app policy */
.af-privl{text-align:center;margin:14px 0 4px}.af-privl button{all:unset;cursor:pointer;color:var(--af-mut);font-size:14px;text-decoration:underline;padding:10px 12px}
.af-pol{line-height:1.95}.af-pol h2{font:700 19px/1.5 "Noto Naskh Arabic",Lora,serif;margin:22px 0 2px;border-top:1px solid var(--af-line);padding-top:14px}.af-pol p{margin:8px 0}.af-pol ul{margin:8px 0;padding-inline-start:22px}.af-pol li{margin:6px 0}
