:root{
  --bg:#fdfcf8; --surface:#ffffff; --ink:#24302a; --muted:#5d6b62;
  --line:#e4e0d4; --green:#2e6b4f; --green-dark:#23543e; --green-soft:#eef5f0;
  --amber:#b98a2f; --amber-soft:#fbf6e9; --red:#9b3a2e; --red-soft:#fbeeec;
  --radius:12px; --max:720px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  font-size:17px;line-height:1.65;-webkit-text-size-adjust:100%}
a{color:var(--green);text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3{line-height:1.3;color:var(--ink)}
h1{font-size:1.65rem;margin:.2em 0 .4em}
h2{font-size:1.25rem;margin:1.6em 0 .5em}
h3{font-size:1.05rem;margin:1.2em 0 .3em}
p{margin:.5em 0}
small,.muted{color:var(--muted)}
.wrap{max-width:var(--max);margin:0 auto;padding:0 16px 48px}
header.site{border-bottom:1px solid var(--line);background:var(--surface)}
header.site .wrap{display:flex;align-items:center;gap:12px;padding-top:14px;padding-bottom:14px}
.brand{font-weight:700;font-size:1.15rem;color:var(--ink)}
.brand span{color:var(--green)}
nav.main{margin-left:auto;display:flex;gap:14px;font-size:.95rem}
nav.main a{color:var(--ink)}
nav.main a:hover{color:var(--green)}
.hero{position:relative;overflow:hidden;margin:20px 0 8px;padding:38px 24px 30px;border-radius:16px;
  color:#fff;text-align:center;
  background:linear-gradient(135deg,#16382a 0%,#2e6b4f 52%,#1d4a37 100%);
  background-size:180% 180%;
  box-shadow:0 12px 32px rgba(35,84,62,.28)}
.hero::before{content:"";position:absolute;inset:0;pointer-events:none;
  background-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'><g fill='none' stroke='%23ffffff' stroke-opacity='0.14'><rect x='17' y='17' width='22' height='22'/><rect x='17' y='17' width='22' height='22' transform='rotate(45 28 28)'/><circle cx='28' cy='28' r='2.5'/></g></svg>");
  background-size:56px 56px}
.hero::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(120% 90% at 85% 0%,rgba(232,201,122,.30),rgba(232,201,122,0) 55%)}
.hero>*{position:relative;z-index:1}
.hero-arabic{font-family:"Amiri","Traditional Arabic","Noto Naskh Arabic",serif;font-weight:700;
  font-size:clamp(2.4rem,10vw,3.2rem);line-height:1.5;color:#e8c97a;margin:0}
.hero-arabic::after{content:"";display:block;width:56px;height:2px;border-radius:2px;background:#c9a24a;margin:8px auto 0}
.hero h1{color:#fff;font-size:clamp(1.7rem,6vw,2.25rem);letter-spacing:-.01em;line-height:1.22;margin:.4em 0 .35em}
.hero p.lead{font-size:1.05rem;color:#d9e9df;max-width:34em;margin-left:auto;margin-right:auto}
.hero .searchbox{max-width:560px;margin-left:auto;margin-right:auto}
.hero .searchbox input{border-color:#fff;box-shadow:0 2px 10px rgba(0,0,0,.18)}
.hero .searchbox button{background:#fff;color:var(--green-dark);font-weight:600}
.hero .searchbox button:hover{background:#f0f6f2}
.hero #search-results{text-align:left}
.hero #search-results a{box-shadow:0 2px 10px rgba(0,0,0,.15)}
@media (prefers-reduced-motion: no-preference){
  .hero{animation:hero-drift 18s ease-in-out infinite alternate}
  .hero>*{animation:hero-rise .7s ease both}
  .hero>*:nth-child(2){animation-delay:.08s}
  .hero>*:nth-child(3){animation-delay:.16s}
  .hero>*:nth-child(4){animation-delay:.24s}
  @keyframes hero-drift{from{background-position:0% 0%}to{background-position:100% 100%}}
  @keyframes hero-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
}
.searchbox{display:flex;gap:8px;margin:18px 0 6px}
.searchbox input{flex:1;min-width:0;font:inherit;padding:12px 14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);color:var(--ink)}
.searchbox button{font:inherit;padding:12px 18px;border:0;border-radius:var(--radius);background:var(--green);color:#fff;cursor:pointer}
.searchbox button:hover{background:var(--green-dark)}
#search-results{list-style:none;margin:8px 0 0;padding:0}
#search-results li{margin:0 0 6px}
#search-results a{display:block;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:10px 14px;color:var(--ink)}
#search-results a:hover{border-color:var(--green);text-decoration:none}
#search-results .cat{font-size:.85rem;color:var(--muted)}
.cards{display:grid;grid-template-columns:1fr;gap:12px;margin:14px 0}
@media(min-width:560px){.cards{grid-template-columns:1fr 1fr}}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px}
.card h3{margin-top:0}
.card p{color:var(--muted);font-size:.95rem;margin-bottom:8px}
.card a.more{font-weight:600}
.seq-card{border-left:4px solid var(--green)}
ul.linklist{list-style:none;margin:0;padding:0}
ul.linklist li{border-bottom:1px solid var(--line)}
ul.linklist li:last-child{border-bottom:0}
ul.linklist a{display:flex;justify-content:space-between;gap:10px;padding:11px 2px;color:var(--ink)}
ul.linklist a:hover{color:var(--green);text-decoration:none}
ul.linklist .cat{font-size:.85rem;color:var(--muted);white-space:nowrap}
.crumb{font-size:.9rem;color:var(--muted);margin:18px 0 4px}
.crumb a{color:var(--muted)}
.item{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin:16px 0}
.item h2{margin-top:0;font-size:1.15rem}
.item h2 .num{color:var(--green);margin-right:6px}
.arabic{direction:rtl;text-align:right;font-family:"Amiri Quran","Scheherazade New","Traditional Arabic","Noto Naskh Arabic",serif;
  font-size:1.7rem;line-height:2.1;margin:14px 0;color:#1d2b23}
.latin{font-style:italic;color:#37463d;background:var(--green-soft);border-radius:8px;padding:12px 14px}
.meaning{margin-top:12px}
.refs{font-size:.9rem;color:var(--muted);border-top:1px dashed var(--line);margin-top:14px;padding-top:10px}
.refs p{margin:.3em 0}
.note{font-size:.92rem;background:var(--amber-soft);border:1px solid #eadfc0;border-radius:8px;padding:10px 14px;margin-top:12px}
.note.warn{background:var(--red-soft);border-color:#e8c8c2}
.counter{display:flex;align-items:center;gap:10px;margin-top:14px;flex-wrap:wrap}
.counter button{font:inherit;cursor:pointer;border:1px solid var(--green);background:var(--surface);color:var(--green);border-radius:999px;padding:8px 16px}
.counter button.main{background:var(--green);color:#fff;border-color:var(--green)}
.counter button:hover{opacity:.9}
.counter .count{font-weight:700;min-width:64px;text-align:center}
.counter .done{color:var(--green);font-weight:600}
.item-actions{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
.item-actions button,.item-actions a{font:inherit;font-size:.9rem;cursor:pointer;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:999px;padding:7px 14px}
.item-actions button:hover,.item-actions a:hover{border-color:var(--green);color:var(--green);text-decoration:none}
.progress{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;margin:16px 0;display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.progress button{font:inherit;cursor:pointer;border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:7px 14px}
.disclaimer{font-size:.9rem;color:var(--muted);border:1px solid var(--line);border-radius:var(--radius);padding:12px 16px;margin:24px 0;background:var(--surface)}
footer.site{border-top:1px solid var(--line);margin-top:32px;padding:20px 0 40px;font-size:.92rem;color:var(--muted)}
footer.site a{color:var(--muted)}
footer.site nav{display:flex;gap:16px;flex-wrap:wrap;margin-bottom:8px}
.faq h3{margin-bottom:2px}
.toc{list-style:none;padding:0;margin:12px 0}
.toc li{margin:6px 0}
.toc a{color:var(--ink)}
.toc a:hover{color:var(--green)}
.toc .n{color:var(--green);font-weight:600;margin-right:8px}
@media(max-width:480px){
  body{font-size:16px}
  .arabic{font-size:1.5rem;line-height:2}
  nav.main{gap:10px;font-size:.9rem}
  h1{font-size:1.45rem}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
