/* =========================================================================
   Wise Human — theme layer (loaded after app.css; palettes are in css/palettes.css)
   layout (side navigation + top bar, mobile drawer) · ornaments (parchment, stars, arch, skyline) · component refinements
   ========================================================================= */

/* ------------------------------------------------------------------ 3. ornaments (shared) */
html[lang='fa'] { --font-display: 'Vazirmatn', 'Noto Naskh Arabic', sans-serif; }
html[lang='fa'] h1, html[lang='fa'] .hero2 h1 { font-weight: 800; }

html { background: var(--bg); }
body { background: transparent; }
/* parchment: a faint paper grain + soft golden light, fixed behind everything */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: calc(var(--paper-a) * 5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .31 0 0 0 0 .16 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(1100px 520px at 25% -8%, color-mix(in srgb, var(--gold) 15%, transparent), transparent 62%), radial-gradient(900px 500px at 100% 100%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 60%);
}

.orn { --m: url('/img/pattern.svg'); }
.orn::before, .sidebar::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; background: var(--gold); opacity: .09;
  -webkit-mask: var(--m, url('/img/pattern.svg')) 0 0 / 72px 72px; mask: var(--m, url('/img/pattern.svg')) 0 0 / 72px 72px;
}

/* ------------------------------------------------------------------ 2. layout */
.app-shell { display: block; }
.shell { display: grid; grid-template-columns: 276px minmax(0, 1fr); min-height: 100dvh; }
.content { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.content > main { flex: 1; }

.sidebar {
  position: sticky; top: 0; height: 100dvh; align-self: start; overflow-x: hidden; overflow-y: auto; display: flex; flex-direction: column;
  padding: 26px 16px 18px; background: var(--side-bg); color: var(--side-ink); z-index: 60;
  border-inline-end: 1px solid color-mix(in srgb, var(--gold) 28%, transparent);
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25);
}
[dir='rtl'] .sidebar { box-shadow: inset 1px 0 0 rgba(0, 0, 0, .25); }
.sidebar > * { position: relative; z-index: 1; }
.sb-skyline {
  position: absolute !important; inset-inline: 0; bottom: 0; height: 130px; z-index: 0 !important; pointer-events: none; background: var(--gold); opacity: .2;
  -webkit-mask: url('/img/skyline.svg') bottom / 100% 100% no-repeat; mask: url('/img/skyline.svg') bottom / 100% 100% no-repeat;
}
.sb-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: inherit; padding: 4px 8px 18px; border-bottom: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); margin-bottom: 14px; }
.sb-brand:hover { text-decoration: none; }
.sb-emblem { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; padding: 5px; background: radial-gradient(circle at 35% 28%, #fff7e4, #e6d3a8); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 70%, transparent), 0 10px 26px rgba(0, 0, 0, .35); }
.sb-emblem img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.sb-name {
  font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; line-height: 1.5; letter-spacing: .01em;
  background: linear-gradient(180deg, #f6dd9b, #c99a3c 70%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
}
.sb-nav { display: flex; flex-direction: column; gap: 5px; padding-block: 2px; flex: 0 0 auto; }
.sb-nav a {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; color: var(--side-ink); font-weight: 700; font-size: 1rem; opacity: .88;
  border: 1px solid transparent; transition: background .15s, opacity .15s, border-color .15s;
}
.sb-nav a .ic { color: color-mix(in srgb, var(--gold) 82%, #fff); }
.sb-nav a:hover { background: rgba(255, 255, 255, .07); opacity: 1; text-decoration: none; }
.sb-nav a.active { background: rgba(255, 255, 255, .12); border-color: color-mix(in srgb, var(--gold) 45%, transparent); opacity: 1; box-shadow: 0 6px 18px rgba(0, 0, 0, .22); }
.sb-nav a.active .ic { color: var(--gold); }
.sb-foot { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; padding-bottom: 100px; align-items: center; margin-top: auto; }
.sb-foot .socials { justify-content: center; gap: 8px; }
.sb-foot .social { width: 38px; height: 38px; border-radius: 50%; background: transparent; border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); color: var(--side-ink); box-shadow: none; }
.sb-foot .social:hover { background: var(--gold); color: #2a1a05; }
.sb-foot .store-btns { flex-direction: column; align-items: stretch; width: 100%; gap: 8px; }
.sb-foot .store { justify-content: flex-start; padding: 7px 14px; border-radius: 12px; background: #0a0a0a; border-color: #3a3a3a; font-size: .95rem; }
.sb-foot .store .ic { width: 22px; height: 22px; }
.sb-foot .hint { font-size: .78rem; opacity: .7; text-align: center; margin: 0; }

.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: 62px; padding: env(safe-area-inset-top) clamp(14px, 3vw, 34px) 0;
  background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(1.3) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar .burger, .topbar .tb-brand { display: none; }
.crumbs { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: .95rem; color: var(--muted); min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs i { font-style: normal; opacity: .5; }
.topbar .header-actions { margin-inline-start: auto; }
.look-pop { min-width: 250px; padding: 14px; cursor: default; }
.look-pop h4 { margin: 0 0 8px; font-size: .8rem; color: var(--muted); letter-spacing: .03em; }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.sw { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); font-size: .72rem; font-weight: 700; color: var(--muted); }
.sw i { width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(from 200deg, var(--s1) 0 50%, var(--s2) 50% 100%); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.sw:hover { border-color: var(--brand); }
.sw.on { border-color: var(--brand); color: var(--ink); background: var(--brand-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.modes button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); font-weight: 700; font-size: .8rem; color: var(--muted); }
.modes button.on { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }

.sb-scrim { display: none; }
@media (max-width: 1020px) {
  .sb-emblem { width: 76px; height: 76px; }
  .sb-brand { padding-bottom: 12px; margin-bottom: 8px; gap: 6px; }
  .sb-nav a { padding: 10px 14px; }
  .shell { display: block; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(84vw, 310px); transform: translateX(-104%); transition: transform .26s ease; box-shadow: var(--shadow-l); z-index: 80; padding-top: calc(22px + env(safe-area-inset-top)); }
  [dir='rtl'] .sidebar { transform: translateX(104%); }
  .sb-open .sidebar { transform: none; }
  .sb-open .sb-scrim { display: block; position: fixed; inset: 0; z-index: 75; background: rgba(0, 0, 0, .5); }
  .topbar .burger { display: inline-grid; }
  .topbar .tb-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--head); min-width: 0; }
  .topbar .tb-brand img { width: 34px; height: 34px; border-radius: 50%; background: #f8ece1; padding: 2px; box-shadow: var(--shadow-s); }
  .topbar .tb-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 44vw; }
  .crumbs { display: none; }
  .topbar { height: 56px; }
}
@media (max-width: 900px) { :root { --header-h: 56px; } }
@media (min-width: 1021px) { :root { --header-h: 62px; } }

/* ------------------------------------------------------------------ 4. components */
.btn { border-radius: 12px; }
.btn-primary { background: linear-gradient(180deg, color-mix(in srgb, var(--btn) 88%, #fff), var(--btn)); border-color: var(--btn); color: var(--btn-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--btn) 34%, transparent); }
.btn-primary:hover { background: var(--btn); filter: brightness(1.07); }
.chip, .badge { letter-spacing: 0; }

/* section titles with the diamond ornament */
.orn-title { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 26px; text-align: center; }
.orn-title h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 3.2vw, 2.2rem); color: var(--head); }
.orn-title::before, .orn-title::after { content: ''; flex: 1; max-width: 190px; height: 11px; background:
  linear-gradient(var(--gold), var(--gold)) center / 100% 1.5px no-repeat; opacity: .85; }
.orn-title::before { -webkit-mask: linear-gradient(90deg, transparent, #000 40%); mask: linear-gradient(90deg, transparent, #000 40%); }
.orn-title::after { -webkit-mask: linear-gradient(270deg, transparent, #000 40%); mask: linear-gradient(270deg, transparent, #000 40%); }
[dir='rtl'] .orn-title::before { -webkit-mask: linear-gradient(270deg, transparent, #000 40%); mask: linear-gradient(270deg, transparent, #000 40%); }
[dir='rtl'] .orn-title::after { -webkit-mask: linear-gradient(90deg, transparent, #000 40%); mask: linear-gradient(90deg, transparent, #000 40%); }
.orn-title .dia { width: 10px; height: 10px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--gold); flex: none; }
.orn-rule { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--gold); }
.orn-rule::before, .orn-rule::after { content: ''; flex: 1; height: 1.5px; background: linear-gradient(90deg, transparent, var(--gold)); }
.orn-rule::after { transform: scaleX(-1); }
.orn-rule i { width: 9px; height: 9px; transform: rotate(45deg); background: var(--gold); }

/* hero */
.hero2 { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: clamp(20px, 4vw, 60px); padding: clamp(24px, 4.5vw, 64px) clamp(16px, 4vw, 52px) clamp(18px, 3vw, 34px); }
.hero2-text .eyebrow { background: transparent; border: 0; box-shadow: none; padding: 0; color: var(--accent); gap: 10px; font-size: .95rem; }
.hero2-text .eyebrow::after { content: ''; width: 46px; height: 1.5px; background: var(--gold); }
.hero2 h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, 5.4vw, 4.3rem); line-height: 1.4; color: var(--head); margin: .1em 0 .2em; text-wrap: balance; }
html[lang='fa'] .hero2 h1, html[lang='ur'] .hero2 h1 { line-height: 1.65; }
.hero2 .lead { font-size: clamp(1.05rem, 2vw, 1.4rem); font-weight: 700; color: var(--ink); margin-bottom: .5em; }
.hero2 .desc { color: var(--muted); max-width: 58ch; font-size: 1.04rem; }
.hero2 .cta-row { margin-top: 22px; }
.arch-wrap { display: grid; place-items: center; position: relative; }
.arch { position: relative; width: min(100%, 360px); aspect-ratio: 4 / 5; padding: 9px; border-radius: 999px 999px 24px 24px; background: linear-gradient(160deg, #f1d68c, #b98b32 55%, #e3bf6a); box-shadow: var(--shadow-l); }
.arch-in { position: relative; height: 100%; border-radius: 999px 999px 17px 17px; overflow: hidden; display: grid; place-items: center; isolation: isolate;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--btn) 82%, #fff 6%), color-mix(in srgb, var(--btn) 45%, #000) 78%); }
.arch-in::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--gold); opacity: .13; -webkit-mask: url('/img/pattern.svg') 0 0 / 66px 66px; mask: url('/img/pattern.svg') 0 0 / 66px 66px; }
.arch-in::after { content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 28%; z-index: -1; background: linear-gradient(transparent, rgba(0, 0, 0, .35)); }
.arch-in img.cover3d { width: 74%; filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .5)); animation: float 7s ease-in-out infinite; }
.arch-in .cover-wrap { width: 70%; }
.arch-in img.emblem-art { width: 66%; border-radius: 50%; background: #f5e8cc; padding: 6px; }

.home-search { display: flex; align-items: stretch; width: min(100%, 760px); margin: 6px auto 8px; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); box-shadow: var(--shadow-m); }
.home-search button { flex: none; width: 62px; border: 0; background: var(--btn); color: var(--btn-ink); display: grid; place-items: center; }
.home-search button:hover { filter: brightness(1.1); }
.home-search input { flex: 1; min-width: 0; height: 56px; padding: 0 20px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.05rem; outline: none; }
.home-search input::placeholder { color: var(--muted); opacity: .8; }

/* tiles (explore + languages) */
.tiles { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
a.tile, .lang-card.tile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; min-height: 176px; padding: 22px 22px 18px; border-radius: 18px; color: var(--ink); text-align: start; isolation: isolate;
  background: linear-gradient(150deg, var(--surface), color-mix(in srgb, var(--brand) 9%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--line)); box-shadow: var(--shadow-s); transition: transform .18s, box-shadow .18s, border-color .18s;
}
a.tile:nth-child(3n+2), .lang-card.tile:nth-child(3n+2) { background: linear-gradient(150deg, var(--surface), color-mix(in srgb, var(--gold) 16%, var(--surface))); }
a.tile::before, .lang-card.tile::before { content: ''; position: absolute; inset-inline-end: -26px; bottom: -26px; width: 170px; height: 170px; z-index: -1; background: var(--brand); opacity: .09;
  -webkit-mask: url('/img/pattern.svg') center / 56px 56px; mask: url('/img/pattern.svg') center / 56px 56px; border-radius: 50%; }
a.tile:hover, .lang-card.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-m); text-decoration: none; border-color: var(--gold); }
.tile .t-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: var(--btn-ink); background: linear-gradient(160deg, var(--btn), color-mix(in srgb, var(--btn) 62%, #000)); box-shadow: 0 8px 18px color-mix(in srgb, var(--btn) 32%, transparent), inset 0 0 0 1.5px color-mix(in srgb, var(--gold) 70%, transparent); }
.tile h3 { margin: 6px 0 0; font-size: 1.2rem; font-weight: 800; color: var(--head); }
.tile p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.65; }
.tile .t-go { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 10px; background: var(--btn); color: var(--btn-ink); font-size: .85rem; font-weight: 700; }
.lang-card.tile { cursor: pointer; }
.lang-card.tile.current { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 38%, transparent), var(--shadow-m); }
.lang-card.tile .ln { color: var(--accent); font-weight: 800; font-size: .8rem; letter-spacing: .02em; }
.lang-card.tile .lt { font-size: 1.3rem; font-weight: 800; color: var(--head); line-height: 1.55; }
.badge.on { background: var(--btn); color: var(--btn-ink); }

/* generic cards, library, banners */
.card, .vinfo, .bk, .vcard, .track, .empty, .share-box, .toc { border-color: color-mix(in srgb, var(--gold) 30%, var(--line)); }
.card { background: var(--surface); }
.page-head { padding: clamp(22px, 3.4vw, 40px) 0 6px; position: relative; }
.page-head h1 { font-weight: 800; color: var(--head); }
.page-head::after { content: ''; display: block; width: 72px; height: 3px; margin-top: 14px; border-radius: 3px; background: linear-gradient(90deg, var(--gold), transparent); }
[dir='rtl'] .page-head::after { background: linear-gradient(270deg, var(--gold), transparent); }
.lib-hero, .live-banner { position: relative; overflow: hidden; isolation: isolate; border-radius: 22px; color: #fff7ea; border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  background: radial-gradient(520px 240px at 100% 0, color-mix(in srgb, var(--gold) 30%, transparent), transparent 62%), linear-gradient(135deg, var(--btn), color-mix(in srgb, var(--btn) 55%, #000)); }
.lib-hero::before, .live-banner::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--gold); opacity: .1; -webkit-mask: url('/img/pattern.svg') 0 0 / 64px 64px; mask: url('/img/pattern.svg') 0 0 / 64px 64px; }
html[data-palette='onyx'][data-theme='dark'] .lib-hero, html[data-palette='onyx'][data-theme='dark'] .live-banner { color: #f2e2b4; }
.live-banner .btn { background: #fff7ea; color: #3b0d17; border-color: #fff7ea; }
.lib-hero h1, .live-banner h2 { color: #fff7ea; }
.chapter-nav a.prev { background: linear-gradient(135deg, #c79a46, #8f651e); }
.chapter-nav a.next { background: linear-gradient(135deg, var(--btn), color-mix(in srgb, var(--btn) 60%, #000)); color: var(--btn-ink); }
.bk-cover .bk-badge { background: var(--btn); color: var(--btn-ink); }
.track .play, .mp-ctrl .play-main { background: var(--btn); color: var(--btn-ink); }
.toc a.active, .main-nav a.active, .seg button.on, .chips button.on { }
.chips button.on { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.prose h1.ch-title { border-bottom-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.prose hr { background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.reader-bar { border-color: color-mix(in srgb, var(--gold) 30%, var(--line)); }
.search-hero { margin-top: 10px; }

/* footer */
.site-footer { position: relative; margin-top: 40px; padding: 38px 0 0; background: transparent; color: var(--ink); overflow: hidden; border-top: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); }
:root[data-theme='dark'] .site-footer, html[data-theme='dark'] .site-footer { background: transparent; border-top-color: color-mix(in srgb, var(--gold) 30%, var(--line)); color: var(--ink); }
.foot-center { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding-bottom: 128px; }
.foot-center .f-emblem { width: 74px; height: 74px; border-radius: 50%; padding: 4px; background: #f5e8cc; box-shadow: 0 0 0 2px var(--gold), var(--shadow-m); }
.foot-center .f-name { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--head); }
.foot-center .f-tag { margin: 0; color: var(--muted); max-width: 54ch; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 4px; }
.foot-links a { color: var(--muted); font-weight: 600; font-size: .92rem; padding: 2px 12px; border-inline-end: 1px solid color-mix(in srgb, var(--line) 120%, transparent); }
.foot-links a:last-child { border: 0; }
.foot-links a:hover { color: var(--brand); text-decoration: none; }
.foot-center .socials { justify-content: center; }
.site-footer .foot-center .social { background: var(--surface); border-color: var(--line); color: var(--brand); box-shadow: var(--shadow-s); }
.site-footer .foot-center .social:hover { background: var(--btn); color: var(--btn-ink); }
.foot-center .store-btns { justify-content: center; }
.foot-sky { position: absolute; inset-inline: 0; bottom: 0; height: 138px; z-index: 0; pointer-events: none; background: var(--brand); opacity: .13; -webkit-mask: url('/img/skyline.svg') bottom / 100% 100% no-repeat; mask: url('/img/skyline.svg') bottom / 100% 100% no-repeat; }
.foot-copy { position: absolute; z-index: 3; inset-inline: 0; bottom: 10px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); padding-inline: 12px; text-align: center; }
.foot-copy a { color: inherit; }
.site-footer .copy, .footer-grid { display: none; }

/* announcement bar */
.announce { display: flex; align-items: center; justify-content: center; gap: 6px 16px; flex-wrap: wrap; padding: 9px 18px; background: linear-gradient(90deg, var(--btn), color-mix(in srgb, var(--btn) 60%, #000)); color: var(--btn-ink); font-weight: 700; font-size: .92rem; text-align: center; border-bottom: 2px solid var(--gold); }
.announce span { display: inline-flex; align-items: center; gap: 8px; }
.announce a { color: var(--gold); font-weight: 800; }
html[data-palette='onyx'][data-theme='dark'] .announce { color: #1a1304; }
html[data-palette='onyx'][data-theme='dark'] .announce a { color: #3a2a06; }

/* mobile tab bar uses the palette too */
@media (max-width: 1020px) {
  .tabbar { border-top-color: color-mix(in srgb, var(--gold) 38%, var(--line)); }
  .hero2 { grid-template-columns: 1fr; text-align: center; padding-top: 14px; }
  .hero2 .arch-wrap { order: -1; }
  .hero2 .arch { width: min(62vw, 260px); }
  .hero2 .desc { margin-inline: auto; }
  .hero2 .cta-row { justify-content: center; }
  .hero2-text .eyebrow { justify-content: center; }
  .foot-center { padding-bottom: 118px; }
  main { padding-bottom: calc(var(--tab-h) + var(--player-h) + env(safe-area-inset-bottom)); }
  .content { padding-bottom: 0; }
  .miniplayer { z-index: 56; }
}
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; gap: 12px; } a.tile, .lang-card.tile { min-height: 150px; padding: 16px 14px 14px; } .tile p { display: none; } .tile .t-ico { width: 44px; height: 44px; } }
@media print { .sidebar, .topbar, .sb-scrim, .foot-sky { display: none !important; } .shell { display: block; } }

/* ------------------------------------------------------------ visitor's font (appearance menu, reader "Aa" button) */
/* js/fonts.js / js/theme-init.js set data-font + --wh-font on <html>; the higher specificity beats the per-language defaults in app.css */
html[data-font][lang] { --font-ui: var(--wh-font), 'Vazirmatn', 'Inter', system-ui, sans-serif; --font-display: var(--wh-font), 'Vazirmatn', serif; --font-read: var(--wh-font), 'Vazirmatn', serif; }
html[data-font='Noto Nastaliq Urdu'][lang] { --read-lh: 2.5; }
html[data-font='Jomhuria'][lang], html[data-font='Katibeh'][lang] { --read-lh: 1.9; font-size: 112%; }
.look-pop .fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-height: 210px; overflow-y: auto; padding: 2px; scrollbar-width: thin; }
.look-pop h4:has(+ .fonts) { margin-top: 16px; }
.look-pop .fonts button { justify-content: flex-start; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface2); color: var(--muted); font-size: .8rem; font-weight: 600; line-height: 1.35; text-align: start; font-family: var(--font-ui); }
.look-pop .fonts button.fdef { grid-column: 1 / -1; }
.look-pop .fonts button:hover { border-color: var(--brand); color: var(--ink); background: var(--surface2); }
.look-pop .fonts button.on { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); font-weight: 700; }
.look-pop { max-height: calc(100vh - 84px); max-height: calc(100dvh - 84px); overflow-y: auto; }
