:root{
  --bg:#F7F8F7; --surface:#FFFFFF; --ink:#000000; --sub:#000000; --line:#E4E9E8;
  /* Secondary/tertiary text tiers — previously #000000 (identical to --ink), which meant every
     "muted" subtitle, card description, footer link and label rendered pure black with zero
     visual hierarchy against headings. Replaced with true grays (13 Aug 2026 dark-mode rewrite
     already did this for [data-theme="dark"]; light mode was missed). Both pass WCAG AA:
     --muted ~7.6:1 and --muted2 ~4.8:1 against white/--bg. */
  /* Darkened one step further on 20 Aug 2026 (user-reported: site text reads as "faded"
     throughout the site). #4B5563/#6B7280 already passed WCAG AA but looked visually thin
     against the light --bg/--surface; #374151/#4B5563 keep the same 3-tier hierarchy
     (muted > muted2 > faint) while reading noticeably bolder/darker everywhere these
     variables are used — footers, card descriptions, labels, article text, and so on,
     sitewide, with zero markup changes required. Dark mode's tiers were already fixed
     13 Aug 2026 and stay as-is. */
  --muted:#374151; --muted2:#4B5563; --faint:#9CA3AF;
  --brand:#0D9488; --accent:#F59E0B; --radius:16px;
  --health:#0D9488; --health-bg:#E4F5F3;
  --preg:#DB2777; --preg-bg:#FCE7F1;
  --medical:#2563EB; --medical-bg:#E7EEFC;
  --math:#7C3AED; --math-bg:#EFE7FC;
  --fin:#15803D; --fin-bg:#E1F3E7;
  --dt:#334155; --dt-bg:#E7E9EC;
  --constr:#C2410C; --constr-bg:#FFEDD5;
  --eng:#0369A1; --eng-bg:#E0F2FE;
  --tech:#4338CA; --tech-bg:#E5E3FA;
  --edu:#0284C7; --edu-bg:#DBEAFE;
  --auto:#57534E; --auto-bg:#E7E5E4;
  --daily:#E11D48; --daily-bg:#FFE4E9;
  --islamic:#059669; --islamic-bg:#D1FAE5;
}
body.theme-pregnancy{ --health:var(--preg); --health-bg:var(--preg-bg); }
body.theme-medical{ --health:var(--medical); --health-bg:var(--medical-bg); }
body.theme-math{ --health:var(--math); --health-bg:var(--math-bg); }
body.theme-finance{ --health:var(--fin); --health-bg:var(--fin-bg); }
body.theme-datetime{ --health:var(--dt); --health-bg:var(--dt-bg); }
body.theme-construction{ --health:var(--constr); --health-bg:var(--constr-bg); }
body.theme-engineering{ --health:var(--eng); --health-bg:var(--eng-bg); }
body.theme-technology{ --health:var(--tech); --health-bg:var(--tech-bg); }
body.theme-education{ --health:var(--edu); --health-bg:var(--edu-bg); }
body.theme-automotive{ --health:var(--auto); --health-bg:var(--auto-bg); }
body.theme-everyday{ --health:var(--daily); --health-bg:var(--daily-bg); }
body.theme-islamic{ --health:var(--islamic); --health-bg:var(--islamic-bg); }
/* ===================================================================
   Dark mode — rewritten 13 August 2026 to fix low-contrast/invisible text.
   Previously only --bg/--surface/--ink/--line flipped for dark mode, while the vast
   majority of text sitewide used hardcoded near-black hex colors (#000/#111/#333/#555
   etc.) instead of variables, so on the dark surface that text became unreadable —
   most visibly in every input/search field, where the typed text was literally black
   on a near-black background. This block now also flips: the new --muted/--muted2/--faint
   secondary-text tiers, and every category's pastel *-bg tint (used by result boxes,
   notice cards, badges) to a darkened equivalent so those boxes blend with the page
   instead of appearing as bright light-mode rectangles floating in a dark page. */
[data-theme="dark"]{
  --bg:#0E1416; --surface:#161D1F; --line:#2A3634;
  --ink:#F3F7F6; --sub:#F3F7F6;
  --muted:#D8E3E1; --muted2:#E4EDEB; --faint:#465350;
  --health-bg:#12312B; --preg-bg:#3A1526; --medical-bg:#132B47; --math-bg:#281C42;
  --fin-bg:#12301F; --dt-bg:#232C36; --constr-bg:#3A2412; --eng-bg:#122B42;
  --tech-bg:#241D42; --edu-bg:#132A44; --auto-bg:#2E2B27; --daily-bg:#3A1421; --islamic-bg:#0F2E23;
}
[data-theme="dark"] .live-badge{background:#0F3D25; color:#4ADE80;}
[data-theme="dark"] .soon-badge{background:#2A2E33; color:#9CA8B3;}
[data-theme="dark"] .note{background:#332B12; border-color:#4D3F16; color:#E8DDA8;}
[data-theme="dark"] .blocked-item{background:#3A1E10; border-color:#5A2E14; color:#FDBA8C;}
[data-theme="dark"] .sharia-notice-top{background:#3A1414; border-color:#F87171; color:#FCA5A5;}
[data-theme="dark"] .lang-banner, [data-theme="dark"] .cookie-banner{background:#05100C;}
[data-theme="dark"] .cookie-accept{background:#FFD166; color:#161D1F;}
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea{
  color-scheme:dark; /* also darkens native date/number picker UI, not just the text field */ }
[data-theme="dark"] ::placeholder{ color:var(--muted2); opacity:1; }
*{box-sizing:border-box;}
body{margin:0;background:var(--bg);color:var(--ink);font-family:'Inter',Arial,sans-serif;line-height:1.6;font-size:17px;}
h1,h2,h3{font-family:'Sora','Inter',Arial,sans-serif; margin:0 0 10px;}
a{color:inherit; text-decoration:none;}
.container{max-width:1100px; margin:0 auto; padding:0 20px;}

/* Topbar */
.topbar{display:flex; align-items:center; justify-content:space-between; padding:14px 20px; border-bottom:1px solid var(--line); background:var(--surface); position:sticky; top:0; z-index:50;}
.brand{font-size:22px; font-weight:800; color:var(--ink); display:flex; align-items:center; gap:8px;}
.brand .dot{width:10px;height:10px;border-radius:50%;background:var(--accent);}
.crumbs{font-size:17px; color:var(--muted); padding:14px 20px 0;}
.crumbs a{color:var(--brand); font-weight:600;}
.topbar-actions{display:flex; gap:10px;}
.tbtn{border:1px solid var(--line); background:var(--surface); color:var(--ink); border-radius:999px; padding:9px 17px; font-size:18px; cursor:pointer; font-weight:600;}

/* Section hero */
.section-hero{padding:34px 20px 10px;}
.section-hero .badge{display:inline-flex; align-items:center; gap:8px; background:var(--health-bg); color:var(--health); font-weight:700; padding:6px 14px; border-radius:999px; font-size:17px; margin-bottom:10px;}
.section-hero p{color:var(--muted); max-width:640px; font-weight:500;}

/* مُضافة 2 أغسطس 2026 — هوية بصرية مميزة لكل فرع فرعي داخل صفحة فهرس القسم (Health/Math وغيرها
   مستقبلًا)، بدل عنوان H2 مسطّح واحد لكل الفروع. أيقونة داخل دائرة ملوّنة، بألوان مختلفة لكل فرع
   عبر متغيّر CSS --bh-color/--bh-bg يُمرَّر Inline لكل فرع. مُعدَّلة لإزالة الخط السفلي الفاصل
   (بطلب المستخدم 2 أغسطس 2026 — لا خط ملون يفصل بين العنوان والعناصر أسفله). */
.branch-header{display:flex; align-items:center; gap:14px; padding:30px 20px 12px; margin:0;}
.branch-header:first-of-type{padding-top:10px;}
.branch-header .branch-icon{width:46px; height:46px; border-radius:13px; display:flex; align-items:center;
  justify-content:center; font-size:26px; flex-shrink:0;
  background:var(--bh-bg, var(--surface)); /* fallback for browsers without color-mix() */
  background:linear-gradient(150deg, color-mix(in srgb, var(--bh-color, var(--brand)) 32%, var(--bh-bg, var(--surface))) 0%, var(--bh-bg, var(--surface)) 100%);
  border:1px solid color-mix(in srgb, var(--bh-color, var(--brand)) 38%, transparent);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.55), inset 0 -3px 5px rgba(0,0,0,.08), 0 3px 8px rgba(0,0,0,.10);}
.branch-header h2{margin:0; font-size:22px; color:var(--ink); line-height:1.3;}
.branch-header .branch-count{font-size:16.5px; color:var(--bh-color, #444); font-weight:700;}

/* Grid of calculator cards (section index page) */
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:14px; padding:10px 20px 40px;}
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:16px; display:flex; flex-direction:column; gap:8px; transition:transform .15s, box-shadow .15s;}
.card:hover{transform:translateY(-3px); box-shadow:0 10px 24px rgba(0,0,0,.08);}
.card .icon{width:40px; height:40px; border-radius:10px; color:var(--health); display:flex; align-items:center; justify-content:center; font-size:21px;
  background:var(--health-bg); /* fallback for browsers without color-mix() */
  background:linear-gradient(150deg, color-mix(in srgb, var(--health) 32%, var(--health-bg)) 0%, var(--health-bg) 100%);
  border:1px solid color-mix(in srgb, var(--health) 38%, transparent);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.55), inset 0 -3px 5px rgba(0,0,0,.08), 0 3px 7px rgba(0,0,0,.10);}
.card h3{font-size:19.5px; margin:0; color:var(--ink);}
.card p{font-size:16.5px; color:var(--muted); margin:0; font-weight:500;}

/* Calculator tool layout */
.tool-wrap{display:grid; grid-template-columns:1.1fr .9fr; gap:24px; padding:20px 20px 10px; align-items:start;}
@media (max-width:800px){ .tool-wrap{grid-template-columns:1fr;} }
.panel{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:22px; min-width:0;}
input[type="datetime-local"], input[type="date"], input[type="time"]{min-width:0; max-width:100%;}
.panel h1{font-size:27px;}
.field-row{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:6px;}
.field-row > div{min-width:0;}
label{font-size:17px; font-weight:600; display:block; margin:10px 0 5px; color:var(--ink);}
input, select{width:100%; padding:16px 14px; border:1px solid var(--line); border-radius:10px; font-size:28px; font-weight:700; background:var(--surface); color:var(--ink);}
.btn{margin-top:16px; width:100%; background:var(--health); color:#fff; border:none; border-radius:12px; padding:20px; font-weight:700; font-size:30px; cursor:pointer;}
.result{margin-top:16px; padding:14px; border-radius:12px; background:var(--health-bg); color:var(--ink); font-weight:700; display:none; overflow-x:auto;}
.result.show{display:block;}
.result .big{font-size:52px; font-weight:800; color:var(--ink);}
.fav-star{cursor:pointer; font-size:22px; padding:11px; margin:-11px -11px 0 0; background:none; border:none; color:var(--faint); float:right;}
.fav-star.active{color:var(--accent);}

/* Article + FAQ */
.article{padding:10px 20px 6px; max-width:760px;}
.article h2{font-size:21px;}
.article p{color:var(--ink); font-size:19px;}
.seo-article{padding:10px 20px 6px; max-width:760px;}
.seo-article h2{font-size:21px;}
.seo-article p{color:var(--ink); font-size:19px; margin-bottom:12px;}
.panel ol{padding-inline-start:20px; font-size:18px; color:var(--ink); margin:10px 0 0;}
.panel ol li{margin-bottom:9px; line-height:1.5;}
.faq{padding:6px 20px 50px; max-width:760px;}
.faq-item{border-bottom:1px solid var(--line); padding:14px 0;}
.faq-item h3{font-size:19px; margin:0 0 6px;}
.faq-item p{margin:0; font-size:17.5px; color:var(--ink);}

footer{padding:30px 20px; text-align:center; color:var(--muted); font-size:17px; border-top:1px solid var(--line); margin-top:20px;}
.note{font-size:16.5px; color:#4A3A08; margin-top:10px; background:#FBF6E7; border:1px solid #F0E4B8; padding:10px 12px; border-radius:10px;}

/* Medical disclaimer box — used above and below results on every /medical/ page (see CLAUDE.md §6) */
.med-disclaimer{font-size:17px; color:#7C2D12; margin:14px 0; background:#FEF2F2; border:1.5px solid #FCA5A5; border-left:5px solid #DC2626; padding:12px 14px; border-radius:10px; line-height:1.6;}
.med-disclaimer strong{color:#B91C1C;}
.med-disclaimer.mini{font-size:16px; margin-top:0;}
.source-tag{display:inline-block; font-size:16px; font-weight:700; color:var(--health); background:var(--health-bg); padding:3px 10px; border-radius:999px; margin-top:4px;}
.trust-bar{display:flex; flex-wrap:wrap; gap:16px; align-items:center; font-size:16px; color:var(--muted); margin:8px 0 4px; padding:10px 14px; background:var(--surface); border:1px solid var(--line); border-radius:10px;}
.trust-bar b{color:var(--ink);}
.related-wrap{padding:6px 20px 10px; max-width:900px;}
.related-wrap h2{font-size:21px;}
.related-wrap .grid{padding:10px 0 20px; grid-template-columns:repeat(auto-fill,minmax(200px,1fr));}
.related-wrap .card{padding:12px;}
.related-wrap .card h3{font-size:17.5px;}
.related-wrap .card p{font-size:16px;}

/* Scientific calculator keypad — used only on /math/scientific-calculator.html */
.calc-grid{display:grid; grid-template-columns:repeat(5,1fr); gap:8px;}
.calc-key{padding:20px 0; border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--ink); font-weight:700; cursor:pointer; font-size:26px;}
/* On narrow phones, 5 columns of 26px keys leaves too little room for multi-character keys
   like "AC", "DEL", "sin", "cos", "log" — they would wrap or overflow their button. Scale the
   keypad down at the same breakpoints already used elsewhere on the site, rather than reducing
   the column count (which would make the keypad feel unfamiliar/rearranged). */
@media (max-width:480px){ .calc-key{padding:14px 0; font-size:17px;} }
@media (min-width:481px) and (max-width:680px){ .calc-key{padding:17px 0; font-size:20px;} }
.calc-key:hover{background:var(--health-bg);}
.calc-key.op{background:var(--health-bg); color:var(--health);}
.calc-key.eq{background:var(--health); color:#fff;}
.calc-key.wide{grid-column:span 2;}

/* ===================================================================
   دعم الاتجاه من اليمين لليسار (RTL) — مضاف 31 يوليو 2026
   للنسخة العربية الكاملة (/ar/) — راجع CLAUDE.md §0-أ
   =================================================================== */
html[dir="rtl"] body{direction:rtl; font-family:'Tajawal',sans-serif;}
/* h1/h2/h3 set their own font-family (Sora/Inter, both Latin-only webfonts) further up this
   file, which — being a direct rule on the element rather than an inherited one — always won
   over the body-level Tajawal above, on every RTL page. Arabic headings were therefore never
   actually rendered in Tajawal, only in whatever Arabic-capable fallback the visitor's OS/browser
   happened to substitute for Sora/Inter (inconsistent across devices, and visibly different from
   the correctly-Tajawal'd paragraph text right below every heading). Fixed 19 Aug 2026. */
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3{font-family:'Tajawal','Sora','Inter',Arial,sans-serif;}
html[dir="rtl"] .crumbs, html[dir="rtl"] .lang-switch{text-align:right;}
html[dir="rtl"] label{display:block; text-align:right;}
html[dir="rtl"] input, html[dir="rtl"] select{text-align:right; direction:rtl;}
html[dir="rtl"] .source-tag, html[dir="rtl"] .trust-bar, html[dir="rtl"] .note{text-align:right;}
html[dir="rtl"] .med-disclaimer{text-align:right; border-left:none; border-right:5px solid #DC2626;}
html[dir="rtl"] .faq-item, html[dir="rtl"] .article, html[dir="rtl"] .seo-article{text-align:right;}
/* The favorite-star button floats to the physical right so it sits in the panel's top corner,
   opposite the heading text. In RTL the heading itself starts from the right, so leaving the
   star on the right too makes the title wrap awkwardly around it — mirror it to the left instead,
   matching how it stays clear of the heading in LTR. Added 13 August 2026. */
html[dir="rtl"] .fav-star{float:left;}
html[dir="rtl"] .copy-btn{margin-right:0; margin-left:6px;}
/* ===================================================================
   Language toggle button — redesigned 14 August 2026: one clickable pill
   (still a single <a>, so it works with no JS and is one "button" as
   requested) showing both language codes at all times — AR in green,
   EN styled like the US flag — so the control reads the same on every
   page instead of a plain text link. The chip for the page's current
   language gets a subtle inset ring (.is-current); the other chip is the
   actual link target. See generate_lang_switch.py for how every page's
   markup was regenerated from this design. */
.lang-switch{display:inline-flex; align-items:center; gap:3px; direction:ltr; border-radius:999px; padding:3px;
  background:var(--surface); border:1.5px solid var(--line); text-decoration:none; cursor:pointer;
  box-shadow:0 2px 6px rgba(0,0,0,.08); transition:box-shadow .15s ease, transform .15s ease; vertical-align:middle;}
.lang-switch:hover{box-shadow:0 4px 12px rgba(0,0,0,.16); transform:translateY(-1px);}
.lang-chip{display:inline-flex; align-items:center; justify-content:center; min-width:30px; height:24px; padding:0 9px;
  border-radius:999px; font-size:13.5px; font-weight:800; letter-spacing:.4px; color:#fff; line-height:1; position:relative; overflow:hidden;}
.lang-chip>span{position:relative; z-index:1;}
.lang-chip.lang-ar{background:linear-gradient(150deg,#34D058,#0F7A3D);}
.lang-chip.lang-en{background:repeating-linear-gradient(#B22234 0 3.4px, #FFFFFF 3.4px 6.8px); text-shadow:0 1px 2px rgba(0,0,0,.65);}
.lang-chip.lang-en::before{content:""; position:absolute; inset:0 55% 45% 0; background:#3C3B6E;
  background-image:radial-gradient(circle,#fff 1px,transparent 1.3px); background-size:5px 5px; background-position:1px 1px;}
.lang-chip:not(.is-current){opacity:.82;}
.lang-switch:hover .lang-chip:not(.is-current){opacity:1;}
.lang-chip.is-current{box-shadow:inset 0 0 0 2px rgba(255,255,255,.75), 0 1px 3px rgba(0,0,0,.25);}
.lang-banner{display:flex; align-items:center; justify-content:center; gap:10px; background:#111; color:#fff; font-size:17px; padding:9px 16px; text-align:center;}
.lang-banner a{color:#FFD166; font-weight:700; text-decoration:underline;}
.lang-banner-close{background:none; border:none; color:#fff; opacity:.7; cursor:pointer; font-size:17px; min-width:44px; min-height:44px; padding:8px; display:inline-flex; align-items:center; justify-content:center;}
.lang-banner-close:hover{opacity:1;}

.cookie-banner{position:fixed; left:0; right:0; bottom:0; z-index:9999; display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:14px; background:#111; color:#fff; font-size:17px; line-height:1.5; padding:14px 20px; box-shadow:0 -2px 12px rgba(0,0,0,.18);}
.cookie-banner p{margin:0; max-width:640px;}
.cookie-banner a{color:#FFD166; font-weight:700; text-decoration:underline;}
.cookie-banner-actions{display:flex; gap:8px; flex-shrink:0;}
.cookie-banner-actions button{padding:8px 16px; border-radius:8px; font-size:17px; font-weight:600; cursor:pointer; border:1px solid rgba(255,255,255,.25);}
.cookie-accept{background:#FFD166; color:#111; border-color:#FFD166;}
.cookie-decline{background:transparent; color:#fff;}
.cookie-accept:hover{opacity:.9;}
.cookie-decline:hover{background:rgba(255,255,255,.08);}

/* ===================================================================
   أدوات قسم التقنية والإنترنت (/technology/) — مُضافة 1 أغسطس 2026
   كلاسات جديدة بحتة، لا تُعدَّل أي قاعدة موجودة أعلاه (راجع CLAUDE.md §0 نقطة 8/9 نمط)
   =================================================================== */
textarea{width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px; font-size:17.5px; background:var(--surface); color:var(--ink); font-family:'Consolas','Menlo',monospace; resize:vertical;}
.mono-box{width:100%; min-height:52px; padding:12px 14px; border-radius:10px; background:var(--health-bg); color:var(--ink); font-family:'Consolas','Menlo',monospace; font-size:26px; word-break:break-all; white-space:pre-wrap; margin-top:8px;}
.copy-btn{display:inline-block; margin-top:8px; margin-right:6px; background:var(--surface); border:1px solid var(--line); color:var(--health); font-weight:700; font-size:16.5px; padding:6px 12px; border-radius:999px; cursor:pointer;}
.copy-btn:hover{background:var(--health-bg);}
.hash-row{display:flex; align-items:center; justify-content:space-between; gap:10px; background:var(--health-bg); border-radius:10px; padding:9px 12px; margin-top:8px; font-family:'Consolas','Menlo',monospace; font-size:16.5px; word-break:break-all;}
.hash-row .algo{font-family:'Inter',Arial,sans-serif; font-weight:700; color:var(--health); min-width:68px; font-size:16px;}
.color-swatch{width:100%; height:64px; border-radius:10px; border:1px solid var(--line); margin-top:10px;}
.seg-btns{display:flex; gap:8px; margin-top:6px;}
.seg-btns button{flex:1; padding:9px; border-radius:10px; border:1px solid var(--line); background:var(--surface); color:var(--ink); font-weight:700; font-size:17px; cursor:pointer;}
.seg-btns button.active{background:var(--health); color:#fff; border-color:var(--health);}
.check-row{display:flex; flex-wrap:wrap; gap:14px; margin:10px 0; font-size:17px; font-weight:600;}
.check-row label{display:flex; align-items:center; gap:6px; margin:0; font-weight:600;}
.check-row input[type=checkbox]{width:auto;}

/* ===================================================================
   ذيل الموقع الجديد (Site Footer) — مُضاف 6 أغسطس 2026
   كلاسات جديدة بحتة، لا تُعدَّل أي قاعدة `footer{...}` الأصلية أعلاه.
   يُستخدم `<footer class="site-footer">` كغلاف جديد حول البنية القديمة.
   =================================================================== */
.site-footer{padding:0; text-align:initial; border-top:1px solid var(--line); margin-top:20px; background:var(--surface);}
.footer-top{max-width:1100px; margin:0 auto; padding:40px 20px 20px; display:grid; grid-template-columns:1.3fr 1fr 1fr; gap:28px;}
.footer-brand{font-family:'Sora',sans-serif; font-weight:800; font-size:21px; color:var(--brand); display:flex; align-items:center; gap:6px;}
.footer-tagline{font-size:18px; color:var(--muted); margin-top:8px; max-width:280px; line-height:1.65; font-weight:500;}
.footer-col h4{font-size:17.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted2); margin:0 0 14px; font-weight:800;}
.footer-col ul{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:11px;}
.footer-col a{color:var(--muted); font-size:18px; font-weight:600; text-decoration:none;}
.footer-col a:hover{color:var(--brand); text-decoration:underline;}
.footer-bottom{max-width:1100px; margin:0 auto; padding:18px 20px 28px; border-top:1px solid var(--line); font-size:17px; font-weight:500; color:var(--muted2); display:flex; flex-wrap:wrap; gap:8px; justify-content:space-between; align-items:center;}
.footer-bottom a{color:var(--muted2); text-decoration:underline;}
@media(max-width:680px){.footer-top{grid-template-columns:1fr;}}
html[dir="rtl"] .footer-top, html[dir="rtl"] .footer-bottom{text-align:right;}
html[dir="rtl"] .footer-tagline{max-width:none;}

/* ===================================================================
   أيقونات الأقسام (صور PNG ثلاثية الأبعاد) — مُضافة 6 أغسطس 2026
   تستبدل الإيموجي في: الصفحة الرئيسية (sections-grid)، صفحة التصنيفات (sec-card)،
   شارة كل صفحة قسم (section-hero badge)، وعناوين المجموعات في calculators.html/sitemap.html.
   كلاسات جديدة بحتة — لا تُعدَّل أي قاعدة emoji/badge قديمة، فقط تُضاف صورة بجانبها أو بدلًا منها.
   =================================================================== */
.sec-card .cat-icon-img{width:60px;height:60px;object-fit:contain;display:block;margin:0 auto;}

/* Homepage-only icon sizing — added 13 August 2026, enlarged 14 August 2026 (68px → 104px), then
   corrected 20 August 2026: the 104px artwork was 2.4x the size of its own .ihs-cat-icon wrapper
   (still fixed at 44px in home.css), so every icon spilled far outside its box and visually collided
   with the card title below it. Fixed by sizing the wrapper to match the artwork instead of leaving
   it fixed, and reduced the artwork itself by ~30% (104px → 73px) so it reads big and clear without
   crowding the title. Scoped to #homeSectionsGrid so categories.html and every other .sec-card grid
   keeps its own 60px size, unaffected. */
#homeSectionsGrid .cat-icon-img{width:73px;height:73px;}
#homeSectionsGrid .ihs-cat-icon{width:auto;height:auto;background:none;border:none;margin-bottom:16px;}
.card .icon.icon-img{background:transparent;padding:0;overflow:hidden;border:none;box-shadow:none;}
.card .icon.icon-img img{width:100%;height:100%;object-fit:contain;}
.badge .cat-icon-img{width:22px;height:22px;object-fit:contain;vertical-align:middle;margin-inline-end:4px;}
.cat-group-h .cat-icon-img{width:24px;height:24px;object-fit:contain;vertical-align:middle;margin-inline-end:4px;}
.hero-visual{max-width:420px;margin:14px auto 0;}
.hero-visual img{width:100%;height:auto;display:block;}
@media(min-width:860px){
  .hero-flex{display:flex;align-items:center;justify-content:center;gap:40px;max-width:1100px;margin:0 auto;text-align:left;padding:0 20px;}
  html[dir="rtl"] .hero-flex{text-align:right;}
  .hero-flex .hero-text{flex:1;}
  .hero-flex .hero-visual{flex:0 0 380px;max-width:380px;margin:0;}
}

/* ===================================================================
   حاسبة المواريث والفرائض (/islamic/inheritance-calculator.html) — مُضافة 8 أغسطس 2026
   كلاسات جديدة بحتة، لا تُعدَّل أي قاعدة قائمة أعلاه.
   =================================================================== */
.madhab-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-top:6px;}
@media(max-width:480px){.madhab-grid{grid-template-columns:1fr;}}
.madhab-card{border:2px solid var(--line); border-radius:12px; padding:14px 10px; text-align:center; cursor:pointer; font-weight:700; background:var(--surface); font-size:18px;}
.madhab-card.selected{border-color:var(--health); background:var(--health-bg); color:var(--health);}
.locked-notice{background:#FBF6E7; border:1px solid #F0E4B8; padding:10px 12px; border-radius:10px; font-size:17px; color:#7C5E10; margin:10px 0; font-weight:600;}
.heir-section{opacity:1;}
.heir-section.locked{opacity:.42; pointer-events:none; user-select:none;}
.heir-group-title{font-size:18px; font-weight:800; color:var(--health); margin:18px 0 4px;}
.heir-row{display:grid; grid-template-columns:1fr 88px; gap:10px; align-items:center; margin:6px 0;}
.heir-row label{margin:0; font-size:17px;}
.heir-check-row{display:flex; align-items:center; gap:8px; margin:8px 0; font-weight:600; font-size:18px;}
.heir-check-row input[type=checkbox]{width:auto;}
.sharia-notice-top{background:#FEF2F2; border:1.5px solid #FCA5A5; border-inline-start:5px solid #DC2626; padding:12px 14px; border-radius:10px; font-size:17px; color:#7C2D12; margin:14px 0; line-height:1.7;}
.sharia-notice-top .en-part{margin-top:8px; display:block; color:#7C2D12; direction:ltr; text-align:left;}
html[dir="rtl"] .sharia-notice-top .en-part{direction:ltr; text-align:left;}
.result-table{width:100%; border-collapse:collapse; margin-top:10px; font-size:17.5px;}
.result-table th,.result-table td{border-bottom:1px solid var(--line); padding:8px 6px; text-align:start;}
.result-table th{color:var(--muted); font-weight:700; font-size:16.5px;}
.blocked-box{margin-top:10px; font-size:17px;}
.blocked-item{color:#9A3412; background:#FFF7ED; border:1px solid #FFEDD5; border-radius:8px; padding:7px 10px; margin:5px 0; font-size:16.5px;}
.estate-step{display:flex; justify-content:space-between; font-size:17.5px; padding:5px 0; border-bottom:1px dashed var(--line);}
.estate-step b{font-weight:800;}
.fiqh-toggle-btn{margin-top:14px; width:100%; background:var(--surface); border:1.5px solid var(--health); color:var(--health); border-radius:12px; padding:11px; font-weight:700; font-size:18px; cursor:pointer;}
.fiqh-detail{display:none; margin-top:12px;}
.fiqh-detail.show{display:block;}
.rule-card{border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin:8px 0; font-size:16.5px; background:var(--bg);}
.rule-card .rid{font-weight:800; color:var(--health); font-size:16px;}
.rule-card .rlabel{font-weight:700; color:var(--ink); margin:3px 0;}
.rule-card .rsrc{color:var(--muted); font-style:italic;}
.change-madhab-btn{margin-top:10px; width:100%; background:#374151; color:#fff; border:none; border-radius:12px; padding:11px; font-weight:700; cursor:pointer;}
.origin-box{display:flex; flex-wrap:wrap; gap:14px; font-size:17px; margin:8px 0; background:var(--health-bg); border-radius:10px; padding:10px 12px;}

/* Note: Rafiq Al-Muslim (the Islamic-tools companion widget) styles now live entirely in
   assets/rafiq/rafiq.css and are only loaded on pages under /islamic/, so they never affect
   this shared stylesheet or any non-Islamic page. See assets/rafiq/loader.js. */

/* ===================================================================
   "Most Searched Calculators" — homepage only, directly under the search bar.
   A short, MANUALLY-curated list (never automated/algorithmic — search volume is not
   tracked or computed anywhere on this site) of the 5 calculator types with the highest
   global search demand. The site owner updates this list by hand whenever the choice
   changes: open index.html / ar/index.html, find <div class="trending-list">, and edit
   the href / icon src / label text of the five <a class="trending-item"> entries — no
   code changes needed elsewhere. Icon size here (22px) is intentionally smaller than
   both the homepage's main category icons (68px) and the categories-page icons (52px).
   =================================================================== */
.trending-calcs{margin-top:14px;}
.trending-label{display:block; font-size:16px; font-weight:700; color:var(--muted); margin-bottom:8px; letter-spacing:.2px;}
.trending-list{display:flex; flex-wrap:wrap; gap:8px;}
.trending-item{display:inline-flex; align-items:center; gap:6px; background:var(--surface); border:1px solid var(--line);
  border-radius:999px; padding:6px 12px; font-size:16.5px; font-weight:600; color:var(--ink); text-decoration:none;
  transition:transform .15s ease, box-shadow .15s ease;}
.trending-item:hover{transform:translateY(-1px); box-shadow:0 4px 10px rgba(0,0,0,.1);}
.trending-item img{width:22px; height:22px; border-radius:50%; object-fit:contain; flex:none;}

/* ===================================================================
   Daily Interactive Islamic Tools (/islamic/) — added 14 August 2026:
   Digital Tasbih Counter, Daily Quran Portion Organizer, Morning & Evening
   Dhikr Counter, Daily Worship Tracker.
   This block also fixes a pre-existing gap: the "hajj-counter-box" family
   of classes used by sai-counter.html and tawaf-counter.html (both EN/AR)
   was referenced in their markup but never defined anywhere in this
   stylesheet, so those two pages rendered with an unstyled plain number
   and default unstyled buttons instead of the intended big-tap-counter
   card. Defining the classes here fixes both existing pages and gives the
   new Tasbih/Dhikr counters below the same trusted counter component.
   Purely additive — no existing rule above is modified.
   =================================================================== */
.hajj-counter-box{background:var(--health-bg); border:1px solid var(--line); border-radius:var(--radius); padding:22px; text-align:center; margin-top:14px;}
.hajj-location-badge{display:inline-block; background:var(--surface); color:var(--health); font-weight:700; font-size:16.5px; padding:5px 14px; border-radius:999px; border:1px solid var(--line);}
.hajj-counter-num{font-size:64px; font-weight:800; color:var(--ink); font-family:'Sora','Inter',Arial,sans-serif; line-height:1.1; margin:10px 0 2px;}
.hajj-counter-label{color:var(--muted); font-size:16.5px; font-weight:600;}
.hajj-counter-dots{display:flex; justify-content:center; gap:7px; margin:14px 0 4px; flex-wrap:wrap;}
.hajj-dot{width:14px; height:14px; border-radius:50%; background:var(--faint); border:1px solid var(--line);}
.hajj-dot.done{background:var(--health); border-color:var(--health);}
.hajj-tap-btn{margin-top:14px; width:100%; background:var(--health); color:#fff; border:none; border-radius:14px; padding:22px; font-weight:800; font-size:21px; cursor:pointer; line-height:1.4;}
.hajj-tap-btn:disabled{opacity:.55; cursor:default;}
.hajj-mini-row{display:flex; gap:10px; margin-top:10px;}
.hajj-mini-btn{flex:1; background:var(--surface); border:1px solid var(--line); color:var(--ink); border-radius:10px; padding:11px; font-weight:700; font-size:16px; cursor:pointer;}
.hajj-mini-btn:hover{background:var(--health-bg);}
.hajj-complete-msg{margin-top:12px; font-weight:700; color:var(--health); font-size:17px;}
.hajj-log{margin-top:14px; text-align:start; max-height:220px; overflow-y:auto;}
.hajj-log .hajj-log-item{font-size:15.5px; color:var(--muted); padding:7px 10px; border-bottom:1px solid var(--line);}

/* Selectable "chip" grid — reusable multi-option picker (dhikr phrase choice,
   short category picks) in the same visual language as .madhab-card. */
.chip-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:10px; margin-top:8px;}
.chip-card{border:2px solid var(--line); border-radius:12px; padding:12px 10px; text-align:center; cursor:pointer; font-weight:700; background:var(--surface); font-size:16.5px;}
.chip-card.selected{border-color:var(--health); background:var(--health-bg); color:var(--health);}

/* Slim progress bar — used where a fixed 7-dot tracker (.hajj-counter-dots)
   doesn't fit a variable target (Tasbih rounds, daily worship completion). */
.progress-track{background:var(--bg); border:1px solid var(--line); border-radius:999px; height:14px; overflow:hidden; margin-top:10px;}
.progress-fill{background:var(--health); height:100%; border-radius:999px; transition:width .25s ease;}

/* Dhikr checklist rows — Morning & Evening Dhikr Counter: one row per adhkar
   item, each with its own tap-to-count target and completion state. */
.dhikr-item{border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin:9px 0; background:var(--surface);}
.dhikr-item.complete{border-color:var(--health); background:var(--health-bg);}
.dhikr-item-top{display:flex; align-items:center; justify-content:space-between; gap:12px;}
.dhikr-item .dhikr-arabic{font-size:20px; font-weight:700; color:var(--ink); line-height:1.6;}
.dhikr-item .dhikr-meta{font-size:14.5px; color:var(--muted); margin-top:3px;}
.dhikr-item .dhikr-count{font-size:22px; font-weight:800; color:var(--health); min-width:64px; text-align:center; flex:none;}
.dhikr-item .dhikr-tap{margin-top:10px; width:100%; background:var(--health); color:#fff; border:none; border-radius:10px; padding:12px; font-weight:700; font-size:16px; cursor:pointer;}
.dhikr-item .dhikr-tap:disabled{opacity:.5; cursor:default;}
.dhikr-item .dhikr-track{margin-top:8px;}

/* Weekly overview grid — Daily Worship Tracker's last-7-days summary. */
.week-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:6px; margin-top:10px;}
.week-cell{text-align:center; padding:8px 2px; border-radius:8px; background:var(--bg); border:1px solid var(--line);}
.week-cell .wc-day{font-weight:700; color:var(--muted); font-size:12px;}
.week-cell .wc-pct{font-weight:800; font-size:15px; margin-top:2px; color:var(--ink);}
.week-cell.full{background:var(--health-bg); border-color:var(--health);}
.week-cell.full .wc-pct{color:var(--health);}

/* Daily Quran Portion Organizer — today's assigned reading range display
   and streak badge. */
.portion-box{background:var(--health-bg); border-radius:var(--radius); padding:18px; text-align:center; margin-top:14px;}
.portion-box .portion-range{font-size:28px; font-weight:800; color:var(--ink); font-family:'Sora','Inter',Arial,sans-serif;}
.portion-box .portion-sub{color:var(--muted); font-size:15.5px; margin-top:5px;}
.streak-badge{display:inline-block; background:var(--accent); color:#111; font-weight:800; padding:6px 14px; border-radius:999px; font-size:16px; margin-top:12px;}

/* Zakat History Tracker — yearly Zakat payment log: summary stat tiles plus
   a deletable list of saved entries. */
.zht-summary{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:14px;}
.zht-stat{background:var(--health-bg); border-radius:12px; padding:12px 8px; text-align:center;}
.zht-stat .zht-stat-val{font-size:19px; font-weight:800; color:var(--ink); font-family:'Sora','Inter',Arial,sans-serif;}
.zht-stat .zht-stat-label{font-size:12.5px; color:var(--muted); margin-top:3px;}
.zht-stat.pending{background:#FFF3CD;}
.zht-stat.pending .zht-stat-val{color:#8A6100;}
[data-theme="dark"] .zht-stat.pending{background:#3A2E0C;}
[data-theme="dark"] .zht-stat.pending .zht-stat-val{color:#F0D485;}
.zht-list{margin-top:14px;}
.zht-row{display:flex; align-items:center; justify-content:space-between; gap:10px; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin-bottom:8px;}
.zht-row-year{font-weight:800; color:var(--health); font-size:15.5px; flex:none; min-width:52px;}
.zht-row-main{flex:1; min-width:0;}
.zht-row-type{font-weight:700; color:var(--ink);}
.zht-row-meta{font-size:13.5px; color:var(--muted); margin-top:2px; overflow-wrap:anywhere;}
.zht-row-amount{font-weight:800; color:var(--ink); font-size:17px; white-space:nowrap; flex:none;}
.zht-del{background:none; border:1px solid var(--line); color:var(--muted); width:32px; height:32px; border-radius:8px; cursor:pointer; font-size:16px; flex:none; line-height:1;}
.zht-del:hover{background:#FEE2E2; border-color:#FCA5A5; color:#DC2626;}
[data-theme="dark"] .zht-del:hover{background:#3A1414; border-color:#7F1D1D; color:#FCA5A5;}
.zht-empty{color:var(--muted); font-size:15px; padding:16px 4px; text-align:center;}

/* ===================================================================
   Instant calculator search (homepage) — assets/js/search.js
   Wraps the existing .search-box input; adds a floating results panel
   beneath it. Bilingual: searches Arabic + English at once and shows
   the current page's language first, the other language as a subline.
   =================================================================== */
.ihs-search-wrap{position:relative; display:inline-block; width:100%; max-width:560px; vertical-align:top;}
.ihs-search-wrap .search-box{margin:0;}
.ihs-search-results{position:absolute; left:0; right:0; top:calc(100% + 8px); z-index:60;
  background:var(--surface); border:1px solid var(--line); border-radius:16px;
  box-shadow:0 16px 40px rgba(0,0,0,.14); overflow:hidden; text-align:start;
  max-height:70vh; overflow-y:auto;}
.ihs-search-item{display:flex; align-items:center; gap:12px; padding:10px 14px; border-bottom:1px solid var(--line); text-decoration:none;}
.ihs-search-item:last-of-type{border-bottom:none;}
.ihs-search-item:hover, .ihs-search-item.is-active{background:var(--health-bg);}
.ihs-search-emoji{font-size:22px; flex:none; width:34px; height:34px; display:flex; align-items:center; justify-content:center;}
.ihs-search-text{min-width:0; flex:1;}
.ihs-search-name{display:block; font-size:16.5px; font-weight:700; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.ihs-search-meta{display:block; font-size:14px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.ihs-search-name mark, .ihs-search-meta mark{background:none; color:var(--brand); font-weight:800; padding:0;}
.ihs-search-empty{padding:16px 14px; font-size:15.5px; color:var(--muted); text-align:center;}
.ihs-search-viewall{display:block; padding:12px 14px; text-align:center; font-size:15px; font-weight:700; color:var(--brand); background:var(--bg); text-decoration:none;}
.ihs-search-viewall:hover{text-decoration:underline;}
@media (max-width:600px){ .ihs-search-results{left:20px; right:20px;} }
