@font-face { font-family: "ASR Naskh"; src: url("fonts/Amiri-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Amiri"; src: url("fonts/Amiri-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "ASR Nastaliq"; src: url("fonts/NotoNastaliqUrdu.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "ASR Devanagari"; src: url("fonts/NotoSansDevanagari.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
:root {
  /* Al Saeed website ka theme: gehra slate + zard */
  --ink: #1d1e22;
  --ink-2: #262a2e;
  --ink-3: #343a40;
  --yellow: #e2a91f;
  --yellow-deep: #c48f10;
  --yellow-soft: #fff4cf;
  --paper: #f3f2ee;
  --card: #ffffff;
  --line: #dedcd3;
  --text: #1c1f22;
  --muted: #666b70;
  --islam: #1f7a4d;
  --bible: #2a5d9f;
  --nt: #7a3f98;
  --hindu: #c8641b;
  --own: #55606b;
  --ui: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  --urdu: "Jameel Noori Nastaleeq", "ASR Nastaliq", "Noto Nastaliq Urdu", "Urdu Typesetting", "Mehr Nastaliq Web", "Segoe UI", Tahoma, serif;
  --hindi: "ASR Devanagari", "Nirmala UI", "Mangal", "Noto Sans Devanagari", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--text); font-family: var(--ui); font-size: 15px; }
button, input, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

/* ---------- sar-e-safha ---------- */
header.top { background: var(--ink); color: #fff; border-bottom: 4px solid var(--yellow); }
.top-in { max-width: 1280px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.mark { height: 46px; width: auto; display: block; }
.brand-txt { direction: ltr; line-height: 1.15; }
.brand-txt b { display: block; color: var(--yellow); font-size: 19px; letter-spacing: 2.5px; font-weight: 800; }
.brand-txt span { font-size: 11.5px; letter-spacing: 3.2px; color: #c9cdd1; text-transform: uppercase; }
.brand-ur { font-family: var(--urdu); font-size: 22px; color: #fff; margin-inline-start: 6px; padding-inline-start: 16px; border-inline-start: 1px solid #454b51; line-height: 1.9; }
.top-links { margin-inline-start: auto; display: flex; gap: 8px; }
.ghost { background: transparent; color: #e8eaec; border: 1px solid #4a5056; padding: 7px 14px; border-radius: 3px; }
.ghost:hover { border-color: var(--yellow); color: var(--yellow); }

/* ---------- talash ---------- */
.hero { background: var(--ink-2); color: #fff; }
.hero-in { max-width: 1280px; margin: 0 auto; padding: 22px 20px 20px; }
.hero h1 { font-family: var(--urdu); font-weight: 400; font-size: 25px; margin: 0 0 12px; line-height: 2; }
.hero h1 em { font-style: normal; color: var(--yellow); }
.searchbar { display: flex; gap: 0; background: #fff; border-radius: 4px; overflow: hidden; border: 2px solid var(--yellow); }
.searchbar input { flex: 1; border: 0; outline: 0; padding: 12px 16px; font-size: 19px; min-width: 0; color: var(--ink); background: #fff; }
.searchbar button { background: var(--yellow); color: var(--ink); border: 0; padding: 0 30px; font-weight: 700; font-size: 17px; }
.searchbar button:hover { background: var(--yellow-deep); }
.opts { display: flex; gap: 18px; align-items: center; margin-top: 12px; flex-wrap: wrap; font-size: 14px; color: #d6d9dc; }
.opts label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.opts input { accent-color: var(--yellow); }
.examples { margin-inline-start: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.examples button { background: transparent; border: 1px dashed #5a6168; color: #e3e6e8; padding: 3px 11px; border-radius: 20px; font-size: 13.5px; }
.examples button:hover { border-color: var(--yellow); color: var(--yellow); }

.chips { background: var(--ink-3); color: #e9ebed; }
.chips-in { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.chiprow { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 9px 0; border-top: 1px solid #454b51; font-size: 14px; }
.chiprow:first-child { border-top: 0; }
.chiprow .tok { direction: ltr; font-weight: 700; color: var(--yellow); }
.chip { border: 1px solid #5f666d; background: transparent; color: #cfd3d6; border-radius: 20px; padding: 1px 12px 3px; font-family: var(--urdu); font-size: 16px; line-height: 1.9; }
.chip.dv { font-family: var(--hindi); line-height: 1.6; padding: 3px 12px; }
.chip.on { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.chip small { font-family: var(--ui); font-size: 11px; opacity: .7; margin-inline-start: 5px; }
.chiphelp { color: #aab0b5; font-size: 12.5px; }

/* ---------- jism ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 18px 20px 40px; min-height: 60vh; display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
@media (max-width: 880px) { main { grid-template-columns: 1fr; } }
aside { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--ink); position: sticky; top: 10px; max-height: calc(100vh - 20px); overflow: auto; }
aside h2 { margin: 0; padding: 11px 14px; font-size: 14.5px; background: #faf9f5; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
aside h2 button { border: 0; background: none; color: var(--bible); font-size: 12.5px; padding: 0; }
.mz { border-bottom: 1px solid var(--line); padding: 8px 0 10px; }
.mz-h { display: flex; align-items: center; gap: 8px; padding: 4px 14px; font-weight: 700; font-size: 15px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.bk { display: flex; align-items: flex-start; gap: 8px; padding: 3px 14px 3px 12px; font-size: 13.5px; line-height: 1.5; cursor: pointer; }
.bk:hover { background: #faf7ea; }
.bk input, .mz-h input { accent-color: var(--ink); margin-top: 3px; }
.bk .nm { flex: 1; }
.bk .ms { color: var(--muted); font-size: 12px; display: block; }
.cnt { font-variant-numeric: tabular-nums; font-size: 12px; background: #eeece4; color: #555; border-radius: 10px; padding: 0 8px; min-width: 26px; text-align: center; direction: ltr; }
.cnt.has { background: var(--yellow); color: var(--ink); font-weight: 700; }
.grp { padding: 6px 14px 2px 14px; font-size: 12px; color: var(--muted); letter-spacing: .3px; }

.summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.summary .big { font-size: 17px; }
.summary .big b { background: var(--yellow); padding: 0 8px; border-radius: 3px; direction: ltr; display: inline-block; }
.summary .sp { flex: 1; }
.btn { background: var(--ink); color: #fff; border: 0; padding: 8px 15px; border-radius: 3px; font-size: 13.5px; }
.btn:hover { background: #000; }
.btn.y { background: var(--yellow); color: var(--ink); font-weight: 700; }
.btn.lt { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.lt:hover { border-color: var(--ink); background: #fff; }

.card { background: var(--card); border: 1px solid var(--line); border-inline-start: 4px solid var(--ink); margin-bottom: 12px; }
.card-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 9px 16px; background: #faf9f5; border-bottom: 1px solid var(--line); font-size: 13px; }
.tag { color: #fff; padding: 1px 10px; border-radius: 3px; font-size: 12.5px; }
.tag.ms { background: #e9e7df; color: #444; }
.card-h .kn { font-weight: 700; font-size: 14.5px; }
.card-h .no { margin-inline-start: auto; color: var(--muted); direction: ltr; font-size: 12px; }
.matn { padding: 12px 18px 6px; font-family: var(--urdu); font-size: 20px; line-height: 2.35; text-align: justify; word-spacing: 1px; }
.matn.dv { font-family: var(--hindi); font-size: 17px; line-height: 1.9; direction: ltr; text-align: left; }
.matn mark { background: var(--yellow); color: var(--ink); padding: 0 3px; border-radius: 3px; }
.sub { padding: 2px 18px 8px; direction: ltr; text-align: left; color: #444; font-size: 14px; line-height: 1.65; }
.sub .lb { display: inline-block; font-size: 11px; background: #eeece4; color: #555; border-radius: 3px; padding: 0 6px; margin-right: 6px; }
.sub mark { background: var(--yellow-soft); }
.ref { margin: 4px 18px 10px; padding: 8px 12px; background: var(--yellow-soft); border-inline-start: 3px solid var(--yellow); font-size: 14px; line-height: 1.75; }
.ref b { color: #7a5600; }
.card-f { display: flex; gap: 8px; padding: 0 18px 12px; }
.mini { background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 4px 12px; font-size: 12.5px; color: #333; }
.mini:hover { border-color: var(--ink); }
.mini.ok { background: var(--islam); color: #fff; border-color: var(--islam); }

.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 18px 0; direction: ltr; flex-wrap: wrap; }
.pager button { min-width: 36px; padding: 6px 10px; background: #fff; border: 1px solid var(--line); border-radius: 3px; }
.pager button.cur { background: var(--ink); color: var(--yellow); border-color: var(--ink); font-weight: 700; }
.pager button:disabled { opacity: .4; cursor: default; }

.empty { background: var(--card); border: 1px solid var(--line); padding: 34px 30px; line-height: 2; }
.empty h3 { font-family: var(--urdu); font-weight: 400; font-size: 24px; margin: 0 0 6px; line-height: 2; }
.empty ul { margin: 6px 0; padding-inline-start: 22px; color: #444; }
.note { background: var(--yellow-soft); border: 1px solid #ecd58a; padding: 10px 14px; font-size: 13.5px; line-height: 1.8; margin-bottom: 12px; }

/* ---------- load ---------- */
#loader { position: fixed; inset: 0; background: var(--ink); color: #fff; display: grid; place-items: center; z-index: 50; }
#loader .bx { width: min(460px, 86vw); text-align: center; }
#loader .mark { margin: 0 auto 16px; height: 96px; }
#loader .lockup { width: min(420px, 84vw); display: block; margin: 0 auto 14px; }
#loader h2 { font-weight: 700; color: #c9cdd1; letter-spacing: 6px; direction: ltr; margin: 0; font-size: 14px; }
#loader p { color: #c9cdd1; margin: 8px 0 18px; }
.bar { height: 8px; background: #3a4046; border-radius: 4px; overflow: hidden; direction: ltr; }
.bar i { display: block; height: 100%; width: 0; background: var(--yellow); transition: width .15s; }
#ldtxt { font-size: 13px; color: #aab0b5; margin-top: 10px; min-height: 20px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(20, 22, 24, .62); display: none; place-items: center; z-index: 40; padding: 18px; }
.modal.show { display: grid; }
.dlg { background: #fff; width: min(720px, 100%); max-height: 90vh; overflow: auto; border-top: 5px solid var(--yellow); }
.dlg h3 { margin: 0; padding: 14px 20px; background: var(--ink); color: #fff; display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.dlg h3 button { background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; }
.dlg .bd { padding: 16px 20px 20px; line-height: 1.9; font-size: 14.5px; }
.dlg table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 8px 0; }
.dlg td, .dlg th { border: 1px solid var(--line); padding: 5px 9px; text-align: start; vertical-align: top; }
.dlg th { background: #faf9f5; }
.frm { display: grid; grid-template-columns: 150px 1fr; gap: 9px 12px; align-items: center; margin: 12px 0; }
.frm input[type=text], .frm select { padding: 7px 9px; border: 1px solid #bbb; border-radius: 3px; width: 100%; }
.own-row { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); padding: 6px 10px; margin-top: 6px; }
footer { text-align: center; background: var(--ink); border-top: 4px solid var(--yellow); color: #aab0b5; font-size: 12.5px; padding: 22px 20px 24px; direction: ltr; }
footer img { height: 64px; max-width: 90%; display: block; margin: 0 auto 8px; }

/* ---------- post card ---------- */
.dlg.wide { width: min(1040px, 100%); }
.mini.pc { background: var(--yellow); border-color: var(--yellow); color: var(--ink); font-weight: 700; }
.pc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .pc { grid-template-columns: 1fr; } }
.pc-prev { background: #e7e5dd; padding: 12px; display: grid; place-items: center; position: sticky; top: 0; }
.pc-prev canvas { max-width: 100%; max-height: 66vh; box-shadow: 0 6px 22px rgba(0, 0, 0, .28); }
.pc-ctl label { display: block; font-weight: 700; font-size: 13px; margin: 10px 0 4px; }
.pc-ctl textarea { width: 100%; font-family: var(--urdu); font-size: 16px; line-height: 2; padding: 6px 10px; border: 1px solid #bbb; border-radius: 3px; resize: vertical; }
.pc-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pc-opt { background: #fff; border: 2px solid var(--line); border-radius: 4px; padding: 5px 10px; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pc-opt i { display: block; width: 62px; height: 34px; border-radius: 2px; }
.pc-opt.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--yellow); }
@media print { header.top, .hero, .chips, aside, .pager, .card-f, footer, .summary button { display: none !important; } main { display: block; } .card { break-inside: avoid; } }

/* ---------- Quran ka Arabi matan ---------- */
.arabi { font-family: "ASR Naskh", "Amiri", "Traditional Arabic", serif; font-size: 27px; line-height: 2.15; padding: 14px 18px 8px; color: #0f4a34; text-align: right; background: #f6faf6; border-bottom: 1px dashed var(--line); }
.trj { font-size: 11.5px; color: var(--muted); padding: 8px 18px 0; letter-spacing: .5px; }
.trj + .matn { padding-top: 0; }

.pc-lab { flex-basis: 100%; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.pc-auto { background: var(--yellow-soft); border-inline-start: 3px solid var(--yellow); padding: 5px 10px; font-size: 13px; margin-bottom: 6px; }
.pc-opt span { font-size: 12px; }

/* ---------- ibadaat aur duain ---------- */
.ghost.gold { background: var(--yellow); color: var(--ink); border-color: var(--yellow); font-weight: 700; }
.ghost.gold:hover { background: var(--yellow-deep); color: var(--ink); }
#ibadat { display: none; max-width: 1280px; margin: 0 auto; padding: 18px 20px 40px; min-height: 70vh; }
body.mode-ib #ibadat { display: block; }
body.mode-ib .hero, body.mode-ib .chips, body.mode-ib main { display: none; }
#ibNav { display: flex; flex-wrap: wrap; gap: 6px; background: var(--ink-2); padding: 10px; border-bottom: 3px solid var(--yellow); position: sticky; top: 0; z-index: 5; }
#ibNav button { background: transparent; color: #e3e6e8; border: 1px solid #4a5056; border-radius: 3px; padding: 7px 14px; font-size: 14.5px; }
#ibNav button:hover { border-color: var(--yellow); }
#ibNav button.on { background: var(--yellow); color: var(--ink); border-color: var(--yellow); font-weight: 700; }
#ibBody h2 { font-family: var(--urdu); font-weight: 400; font-size: 27px; line-height: 2; margin: 14px 0 6px; border-inline-start: 5px solid var(--yellow); padding-inline-start: 12px; }
.ib-h { font-size: 16px; margin: 20px 0 8px; }
.ib-form { display: flex; flex-wrap: wrap; gap: 12px 18px; background: var(--card); border: 1px solid var(--line); padding: 12px 14px; margin-bottom: 10px; }
.ib-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
.ib-form select, .ib-form input { padding: 7px 9px; border: 1px solid #bbb; border-radius: 3px; min-width: 170px; font-weight: 400; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pt { background: var(--ink); color: #fff; padding: 14px 14px 12px; border-bottom: 4px solid var(--yellow); display: flex; flex-direction: column; gap: 2px; }
.pt.dim { background: #fff; color: var(--ink); border: 1px solid var(--line); border-bottom: 4px solid var(--line); }
.pt b { font-family: var(--urdu); font-weight: 400; font-size: 21px; line-height: 1.9; color: var(--yellow); }
.pt.dim b { color: var(--ink); }
.pt .tm { font-size: 28px; font-weight: 700; direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.pt .tm small { font-size: 12px; font-weight: 400; opacity: .75; }
.pt i { font-style: normal; font-size: 12px; opacity: .75; }
.ib-agree { background: #eef6ef; border: 1px solid #c9e0cd; border-inline-start: 4px solid var(--islam); padding: 10px 16px; margin: 10px 0 14px; line-height: 1.95; }
.ib-agree b { color: var(--islam); }
.ib-agree ul { margin: 4px 0; padding-inline-start: 22px; }
.ib-steps { background: var(--card); border: 1px solid var(--line); margin: 0 0 14px; padding: 12px 40px 12px 16px; line-height: 2.05; }
.ib-tw { overflow-x: auto; margin-bottom: 14px; border: 1px solid var(--line); background: var(--card); }
.ib-t { border-collapse: collapse; width: 100%; min-width: 980px; font-size: 13.5px; line-height: 1.75; }
.ib-t th, .ib-t td { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; text-align: start; }
.ib-t tr:first-child th { background: var(--ink); color: var(--yellow); position: sticky; top: 0; white-space: nowrap; }
.ib-t tr th:first-child { background: #faf9f5; width: 130px; }
.ib-t tr:first-child th:first-child { background: var(--ink); }
.ib-t td b { background: var(--yellow-soft); padding: 0 4px; border-radius: 2px; }
.ib-dua .arabi { font-size: 29px; text-align: center; }

.matn.arb { font-family: "ASR Naskh", "Amiri", "Traditional Arabic", serif; font-size: 23px; line-height: 2.1; color: #123; }
.sub.en { font-size: 14.5px; }
.ib-form[hidden] { display: none; }

.pc-share { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.btn.wa { background: #1f9d55; } .btn.wa:hover { background: #17803f; }
.btn.fb { background: #1b5fc4; } .btn.fb:hover { background: #154c9e; }
.btn.tt { background: #111; }
.pc-how { margin-top: 10px; background: var(--yellow-soft); border-inline-start: 3px solid var(--yellow); padding: 8px 12px; font-size: 13.5px; line-height: 1.9; }
.pc-how kbd { background: #fff; border: 1px solid #bbb; border-bottom-width: 2px; border-radius: 3px; padding: 0 6px; font-family: Consolas, monospace; font-size: 12px; direction: ltr; display: inline-block; }

/* ---------- website / mobile ---------- */
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; border-bottom: 3px solid var(--yellow); padding: 10px 18px; z-index: 60; font-size: 14px; max-width: 92vw; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
#toast[hidden] { display: none; }
.bk.off { opacity: .72; }
.cnt.dl { background: #fff; border: 1px solid var(--yellow-deep); color: #7a5600; }
.lazy-note { background: var(--yellow-soft); border-bottom: 1px solid #ecd58a; padding: 9px 14px; font-size: 12.5px; line-height: 1.8; }
.lazy-note .mini { display: block; margin-top: 6px; background: var(--yellow); border-color: var(--yellow); font-weight: 700; }
.note.lz { margin-bottom: 10px; }
.books-btn { display: none; background: var(--yellow); color: var(--ink); border: 0; border-radius: 3px; padding: 6px 14px; font-weight: 700; }
a.ghost { text-decoration: none; display: inline-block; }
@media (max-width: 880px) {
  .top-in { padding: 10px 12px; gap: 8px; }
  .mark { height: 36px; }
  .brand-ur { display: none; }
  .brand-txt b { font-size: 16px; }
  .top-links { margin-inline-start: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .top-links .ghost { white-space: nowrap; padding: 6px 11px; font-size: 13px; }
  .hero-in { padding: 14px 12px; }
  .hero h1 { font-size: 19px; margin-bottom: 8px; }
  .searchbar input { font-size: 17px; padding: 10px 12px; }
  .searchbar button { padding: 0 18px; }
  .opts { gap: 8px 14px; font-size: 13px; }
  .examples { margin-inline-start: 0; width: 100%; }
  .books-btn { display: inline-block; }
  .chips-in { padding: 0 12px; }
  main { padding: 12px 10px 30px; gap: 10px; }
  aside { display: none; position: static; max-height: 60vh; }
  body.side-open aside { display: block; }
  .card-h { padding: 8px 10px; }
  .matn { font-size: 18px; padding: 10px 12px 4px; text-align: right; }
  .arabi { font-size: 23px; padding: 10px 12px 6px; }
  .matn.arb { font-size: 21px; }
  .sub { padding: 2px 12px 8px; }
  .ref { margin: 4px 10px 10px; font-size: 13px; }
  .card-f { padding: 0 10px 10px; flex-wrap: wrap; }
  .summary .big { font-size: 15px; }
  .empty { padding: 18px 16px; }
  .modal { padding: 0; }
  .dlg, .dlg.wide { width: 100%; max-height: 100vh; height: 100vh; }
  .pc-prev { position: static; }
  .pc-prev canvas { max-height: 46vh; }
  #ibadat { padding: 10px 10px 30px; }
  #ibNav { flex-wrap: nowrap; overflow-x: auto; padding: 8px; }
  #ibNav button { white-space: nowrap; }
  #ibBody h2 { font-size: 22px; }
  .pt-grid { grid-template-columns: repeat(2, 1fr); }
  .pt .tm { font-size: 23px; }
  .ib-dua .arabi { font-size: 24px; }
  .ib-steps { padding: 10px 30px 10px 10px; }
  .frm { grid-template-columns: 1fr; }
  footer img { height: 46px; }
}
html, body { max-width: 100%; overflow-x: hidden; }
@media (max-width: 880px) {
  .ib-form { gap: 10px; }
  .ib-form label { width: 100%; }
  .ib-form select, .ib-form input { min-width: 0; width: 100%; max-width: 100%; }
  .ib-t { min-width: 760px; }
}

.pc-lock { background: #eef6ef; border-inline-start: 3px solid var(--islam); padding: 5px 10px; font-size: 12.5px; margin-bottom: 6px; }
.note.adab { margin-top: 12px; line-height: 2; }
footer .flink { color: var(--yellow); }
