/* زخارف إسلامية: نجمة ثمانية، أركان، إطار مزدوج، شريط هندسي */
:root{
  --gold:#c9a24a;
  --star:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23c9a24a' stroke-width='2'%3E%3Crect x='7' y='7' width='26' height='26'/%3E%3Crect x='7' y='7' width='26' height='26' transform='rotate(45 20 20)'/%3E%3C/g%3E%3Ccircle cx='20' cy='20' r='3' fill='%23c9a24a'/%3E%3C/svg%3E");
  --starSolid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='%23c9a24a' fill-opacity='.18' stroke='%23c9a24a' stroke-width='2'%3E%3Crect x='7' y='7' width='26' height='26'/%3E%3Crect x='7' y='7' width='26' height='26' transform='rotate(45 20 20)'/%3E%3C/g%3E%3C/svg%3E");
  --corner:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23c9a24a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 62V16Q2 2 16 2H62'/%3E%3Cpath d='M9 62V22Q9 9 22 9H62' stroke-width='1' opacity='.6'/%3E%3Cg transform='translate(24 24)'%3E%3Crect x='-9' y='-9' width='18' height='18'/%3E%3Crect x='-9' y='-9' width='18' height='18' transform='rotate(45)'/%3E%3C/g%3E%3Cpath d='M36 9q4 8 12 8M9 36q8 4 8 12' opacity='.7'/%3E%3C/g%3E%3Ccircle cx='24' cy='24' r='2.5' fill='%23c9a24a'/%3E%3Ccircle cx='54' cy='16' r='1.6' fill='%23c9a24a'/%3E%3Ccircle cx='16' cy='54' r='1.6' fill='%23c9a24a'/%3E%3C/svg%3E");
  --band:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cg fill='none' stroke='%23e3c677' stroke-width='1.2'%3E%3Crect x='7' y='1.5' width='11' height='11' transform='rotate(45 12.5 7)'/%3E%3Crect x='7.5' y='2' width='10' height='10'/%3E%3C/g%3E%3C/svg%3E");
}

/* شريط زخرفي أسفل الترويسة */
header{position:relative;padding-bottom:30px!important}
header::after{content:"";position:absolute;left:0;right:0;bottom:0;height:14px;background:var(--band) repeat-x center;background-color:rgba(0,0,0,.18);border-top:1px solid rgba(227,198,119,.7)}
header a.hl-link{color:#fff;font-size:.85rem;opacity:.9;text-decoration:underline;margin-top:6px;display:inline-block}

/* صفحة المصحف المزخرفة */
.pg{padding:36px 38px 34px 34px!important}
.pg::after{content:"";position:absolute;inset:6px;border:1.5px solid rgba(201,162,74,.85);border-radius:6px;box-shadow:inset 0 0 0 5px var(--paper),inset 0 0 0 6px rgba(201,162,74,.4);pointer-events:none}
.cn{position:absolute;width:48px;height:48px;background:var(--corner) center/contain no-repeat;pointer-events:none;z-index:1}
.cn.tl{top:5px;left:5px}
.cn.tr{top:5px;right:5px;transform:scaleX(-1)}
.cn.bl{bottom:5px;left:5px;transform:scaleY(-1)}
.cn.br{bottom:5px;right:5px;transform:scale(-1,-1)}
.ptop{border-bottom:0!important;position:relative;padding-bottom:12px!important;margin-bottom:10px!important}
.ptop::after{content:"";position:absolute;left:0;right:0;bottom:0;height:16px;background:var(--star) center/16px no-repeat;
  -webkit-mask:none;border-bottom:0}
.ptop::before{content:"";position:absolute;left:0;right:0;bottom:7px;height:1px;background:linear-gradient(to left,transparent,rgba(201,162,74,.8) 20%,rgba(201,162,74,.8) 45%,transparent 47%,transparent 53%,rgba(201,162,74,.8) 55%,rgba(201,162,74,.8) 80%,transparent)}
.shead{display:flex!important;align-items:center;justify-content:center;gap:14px;border:0!important;border-block:3px double var(--gold)!important;border-radius:0!important;padding:8px 10px!important;margin:14px 0 8px!important;
  background:var(--starSolid) 0 0/26px repeat,rgba(201,162,74,.10)!important;font-size:1.25rem!important;letter-spacing:.02em}
.shead::before,.shead::after{content:"";width:30px;height:30px;background:var(--star) center/contain no-repeat;flex:none}
.bism{font-size:1.15em;margin:6px 0 8px!important}
.vn{width:2.5em!important;height:2.5em!important;min-width:0!important;border:0!important;border-radius:0!important;margin:0 .15em!important;
  background:var(--star) center/contain no-repeat!important;font:700 .5em/2.5em 'Cairo',sans-serif!important;vertical-align:middle}
@media(max-width:520px){.pg{padding:30px 26px 28px 24px!important}.cn{width:38px;height:38px}}

/* ================= الألوان والتصميم ================= */
html:root{--bg:#f3ecdc;--card:#fffaf0;--ink:#14312a;--muted:#6c7a72;--line:#e2d6b8;--accent:#0f5c4a;--accent2:#b88a2e;--hit:#f7d56b;--hitInk:#14312a;--paper:#fffaf0;--paperEdge:#e6d9b8;--gold:#b88a2e;--shadow:0 8px 24px rgba(40,30,0,.08)}
@media (prefers-color-scheme:dark){html:root{--bg:#0a1412;--card:#11211e;--ink:#ecf2ee;--muted:#8fa89d;--line:#21403a;--accent:#2fb58f;--accent2:#d9b45a;--hit:#7d5f12;--hitInk:#fff;--paper:#14251f;--paperEdge:#21403a;--gold:#d9b45a;--shadow:0 8px 24px rgba(0,0,0,.35)}}
:root{--lattice:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23e3c677' stroke-opacity='.18' stroke-width='1.2'%3E%3Crect x='14' y='14' width='36' height='36'/%3E%3Crect x='14' y='14' width='36' height='36' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='7'/%3E%3C/g%3E%3C/svg%3E");
  --latticeSoft:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23b88a2e' stroke-opacity='.10' stroke-width='1.2'%3E%3Crect x='14' y='14' width='36' height='36'/%3E%3Crect x='14' y='14' width='36' height='36' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E")}

html body{background:var(--bg) var(--latticeSoft);color:var(--ink)}

/* الترويسة */
html header{background:var(--lattice),radial-gradient(120% 140% at 50% 0%,#17806a 0%,#0f5c4a 45%,#06352b 100%)!important;padding:26px 16px 36px!important;box-shadow:0 6px 24px rgba(0,0,0,.25)}
header::before{content:"﷽";display:block;font:400 1.7rem/1 'Amiri Quran','Traditional Arabic',serif;color:#ecd283;text-shadow:0 2px 10px rgba(0,0,0,.35);height:3.4rem;padding-top:.5rem;margin-bottom:.35rem;overflow:visible}
html header h1{font:700 2.1rem/1.4 'Aref Ruqaa','Amiri Quran',serif;color:#fff7de;letter-spacing:.01em;text-shadow:0 2px 12px rgba(0,0,0,.35)}
html header p{color:#d6ead9;opacity:1;font-size:.95rem}
header a.hl-link{color:#ecd283;font-weight:600}

/* التبويبات */
html .tabs{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:5px;gap:4px;box-shadow:var(--shadow)}
html .tab{border:0;background:transparent;border-radius:12px;color:var(--muted);transition:all .2s;padding:11px 8px;display:flex;align-items:center;justify-content:center}
html .tab:hover{color:var(--ink);background:rgba(184,138,46,.12)}
html .tab[aria-selected=true]{background:linear-gradient(135deg,#0f5c4a,#16806a);color:#fff7de;box-shadow:0 4px 14px rgba(15,92,74,.4),inset 0 -3px 0 #d9b45a}

/* البطاقات والحقول */
html .card{background:var(--card);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);position:relative;overflow:hidden}
html .card::before{content:"";position:absolute;top:0;right:0;left:0;height:3px;background:linear-gradient(to left,transparent,var(--gold),transparent)}
html input[type=text],html select{border:1.5px solid var(--line);border-radius:12px;background:color-mix(in srgb,var(--card) 70%,var(--bg));transition:border-color .2s,box-shadow .2s}
html input[type=text]:focus,html select:focus{outline:0;border-color:var(--gold);box-shadow:0 0 0 4px rgba(184,138,46,.22)}
html button.go,html .nav button{background:linear-gradient(135deg,#0f5c4a,#17806a);color:#fff7de;border:0;border-radius:12px;box-shadow:0 4px 12px rgba(15,92,74,.35);transition:transform .15s,box-shadow .15s}
html button.go:hover,html .nav button:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 7px 18px rgba(15,92,74,.45)}
.note{background:linear-gradient(to left,rgba(184,138,46,.14),transparent)!important;border:0!important;border-right:3px solid var(--gold)!important;border-radius:10px!important}

/* النتائج */
html .verse{background:var(--card);border:1px solid var(--line);border-right:4px solid var(--gold);border-radius:16px;box-shadow:var(--shadow);transition:transform .15s}
html .verse:hover{transform:translateY(-2px)}
html .ref{display:flex;flex-wrap:wrap;gap:12px;align-items:center;color:var(--accent);font-weight:700;font-size:.85rem;margin-bottom:2px}
html mark{background:linear-gradient(transparent 52%,rgba(217,180,90,.65) 52%);color:inherit;padding:0 1px;border-radius:0}
html .summary{display:inline-block;background:var(--card);border:1px solid var(--line);border-radius:999px;padding:5px 18px;box-shadow:var(--shadow)}
html .big{font:700 3.4rem/1.2 'Aref Ruqaa','Cairo',serif;background:linear-gradient(135deg,#b88a2e,#e8c872 50%,#b88a2e);-webkit-background-clip:text;background-clip:text;color:transparent;filter:drop-shadow(0 2px 4px rgba(0,0,0,.18))}
html .bar{background:linear-gradient(to left,#d9b45a,#0f5c4a);border-radius:6px;height:9px}
html table th{color:var(--accent);border-bottom:2px solid var(--gold)}
html tr:hover td{background:rgba(184,138,46,.08)}
html a.open{color:var(--accent);font-weight:600}

/* المصحف */
html .book{padding-top:14px}
html .pg{background:var(--paper) radial-gradient(120% 90% at 50% 0%,rgba(255,255,255,.55),transparent 70%);box-shadow:0 14px 34px rgba(40,30,0,.22),0 2px 6px rgba(40,30,0,.12)}
@media (prefers-color-scheme:dark){html .pg{background:var(--paper) radial-gradient(120% 90% at 50% 0%,rgba(255,255,255,.05),transparent 70%)}}
html .ptxt{color:var(--ink)}
html .shead{color:var(--accent)}
html .plabel{color:var(--gold);font-weight:700}
html .nav input[type=range]{accent-color:var(--gold)}
html .stage{filter:none}
html .shead{background:linear-gradient(to left,rgba(184,138,46,.24),rgba(184,138,46,.07) 50%,rgba(184,138,46,.24))!important;color:var(--ink)!important;font-family:'Aref Ruqaa','Amiri Quran',serif!important;font-size:1.55rem!important;font-weight:700}
html .vn{font-size:.62em!important;color:var(--ink)!important}

/* الجزء والحزب */
.ptop{align-items:center;flex-wrap:wrap}
.jh{display:inline-flex;align-items:center;gap:8px;background:linear-gradient(to left,rgba(184,138,46,.20),rgba(184,138,46,.07) 50%,rgba(184,138,46,.20));border:1px solid rgba(184,138,46,.55);border-radius:999px;padding:1px 14px;font-weight:700;font-size:.8rem;color:var(--ink);box-shadow:inset 0 0 0 2px var(--paper)}
.jh .pie{width:19px;height:19px;flex:none}
@media(max-width:520px){.jh{order:3;width:100%;justify-content:center;margin-top:5px}}

/* أرقام الآيات: نجمة بلا نقطة وبخط النسخ */
:root{--starClean:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='%23c9a24a' fill-opacity='.14' stroke='%23c9a24a' stroke-width='2'%3E%3Crect x='7' y='7' width='26' height='26'/%3E%3Crect x='7' y='7' width='26' height='26' transform='rotate(45 20 20)'/%3E%3C/g%3E%3C/svg%3E")}
html .vn{background:var(--starClean) center/contain no-repeat!important;font-family:'Noto Naskh Arabic','Scheherazade New',serif!important;font-weight:700!important;font-size:.76em!important;width:2.3em!important;height:2.3em!important;line-height:2.3em!important;color:var(--ink)!important;letter-spacing:0}
/* بقية الأرقام (الصفحة، الجزء، الحزب) بخط النسخ كذلك */
html .ptop,html .jh,html .plabel{font-family:'Noto Naskh Arabic','Scheherazade New',serif}
html .ptop{font-weight:600}

/* قراءتي: التقدّم والعلامة */
.mine{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.ring{width:62px;height:62px;flex:none}
.ring .rg-bg{fill:none;stroke:var(--line);stroke-width:6}
.ring .rg-fg{fill:none;stroke:var(--gold);stroke-width:6;stroke-linecap:round;transform:rotate(-90deg);transform-origin:32px 32px;transition:stroke-dashoffset .6s}
.ring text{font:700 14px 'Noto Naskh Arabic','Cairo',serif;fill:var(--ink)}
.mtxt{flex:1;min-width:150px;display:flex;flex-direction:column;line-height:1.5}
.mtxt b{font-size:1rem}
.mtxt span{font-size:.82rem;color:var(--muted)}
.mtxt a{cursor:pointer;color:var(--accent);font-weight:700;text-decoration:underline dotted}
html .vn{cursor:pointer;transition:transform .15s}
.vn:hover{transform:scale(1.12)}
.vn:focus-visible{outline:2px solid var(--gold);outline-offset:2px;border-radius:50%}
.vmenu{position:fixed;z-index:100000;min-width:200px;background:var(--card);color:var(--ink);border:1px solid var(--line);border-top:3px solid var(--gold);border-radius:14px;box-shadow:0 14px 34px rgba(0,0,0,.35);padding:6px;font-family:'Cairo',sans-serif;animation:vm .15s ease}
@keyframes vm{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.vm-h{font-size:.78rem;color:var(--muted);padding:6px 10px 4px;border-bottom:1px solid var(--line);margin-bottom:4px}
.vmenu button{display:block;width:100%;text-align:right;background:none;border:0;color:inherit;font:600 .92rem 'Cairo',sans-serif;padding:9px 10px;border-radius:9px;cursor:pointer}
.vmenu button:hover{background:rgba(184,138,46,.16)}
#toast{position:fixed;left:50%;bottom:26px;transform:translate(-50%,20px);background:#0f5c4a;color:#fff7de;border:1px solid #d9b45a;padding:10px 20px;border-radius:999px;font:600 .92rem 'Cairo',sans-serif;opacity:0;pointer-events:none;transition:all .25s;z-index:100001;box-shadow:0 8px 24px rgba(0,0,0,.35)}
#toast.on{opacity:1;transform:translate(-50%,0)}
/* شريط الحرير */
.ribbon{position:absolute;top:-3px;right:70px;width:26px;height:78px;z-index:7;cursor:pointer;background:linear-gradient(90deg,#0b4638,#17806a 45%,#0b4638);clip-path:polygon(0 0,100% 0,100% 100%,50% 82%,0 100%);box-shadow:0 6px 10px rgba(0,0,0,.4)}
.ribbon::before{content:"";position:absolute;inset:5px 6px 22px;border-inline:1.5px solid rgba(233,200,114,.85)}
.ribbon::after{content:"";position:absolute;top:0;left:0;right:0;height:5px;background:linear-gradient(#d9b45a,#a07a1e)}
.ribbon:hover{filter:brightness(1.25)}
/* الزاوية المطوية (يسار أسفل الصفحة) */
.dogcut,.dogear{position:absolute;left:0;bottom:0;width:46px;height:46px;pointer-events:none}
.dogcut{z-index:6;background:var(--bg);clip-path:polygon(0 100%,100% 100%,0 0)}
.dogear{z-index:7;background:linear-gradient(225deg,#f6ecce 0%,#dcc57f 55%,#b88a2e 100%);clip-path:polygon(100% 100%,0 0,100% 0)}

/* بطاقة تابع القراءة في الرئيسية */
html a.resume{display:flex;align-items:center;gap:14px;text-decoration:none;color:var(--ink);margin-bottom:14px;background:linear-gradient(to left,rgba(184,138,46,.16),var(--card) 55%)}
html a.resume[hidden]{display:none}
.rs-ic{font-size:1.8rem}
.rs-tx{flex:1;display:flex;flex-direction:column;line-height:1.5}
.rs-tx b{font-size:1.05rem;color:var(--accent)}
.rs-tx small{color:var(--muted);font-size:.85rem}
.rs-go{color:var(--gold);font-size:1.2rem}
html a.resume:hover{transform:translateY(-2px);transition:transform .15s}

/* موضع الشريط: بين اسم السورة وقرص الجزء فلا يغطي شيئًا */
html .ribbon{right:27%;transform:translateX(50%);height:66px;width:24px}
@media(max-width:520px){html .ribbon{height:40px;width:20px}}

/* اسم السورة بخط أقرب إلى الأندلسي */
html .shead{font-family:'Katibeh','Aref Ruqaa','Amiri Quran',serif!important;font-size:2rem!important;font-weight:400!important;letter-spacing:0;padding:4px 10px 8px!important;line-height:1.6}

html header{padding:0 0 14px!important;display:block}
header::before{content:none}
html header h1{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
html header p,header a.hl-link{display:none}
header .banner{display:block;line-height:0}
header .banner img{display:block;width:100%;height:clamp(96px,18.5vw,265px);object-fit:cover;object-position:center}
header .brand{position:absolute;top:12px;inset-inline-start:14px;line-height:0;z-index:1}
header .brand img{width:76px;height:76px;display:block;border-radius:15px;border:1px solid rgba(227,198,119,.9);box-shadow:0 3px 12px rgba(0,0,0,.35)}
@media (max-width:600px){header .brand{top:6px;inset-inline-start:8px}header .brand img{width:46px;height:46px;border-radius:10px}}
@media (min-width:701px){main{zoom:1.25}}
html .tab{text-align:center;text-decoration:none}
html .tab[aria-current=page]{background:linear-gradient(135deg,#0f5c4a,#16806a);color:#fff7de;box-shadow:0 4px 14px rgba(15,92,74,.4),inset 0 -3px 0 #d9b45a}
html .tabs.main .tab{padding:14px 10px;font-size:1.05rem;font-weight:700}
html .tabs.sub{max-width:460px;margin-inline:auto}
html .tabs.sub .tab{padding:7px 8px;font-size:.9rem}
@media(max-width:600px){html .tabs.main .tab{font-size:.86rem;padding:12px 6px}}
/* الشريط الرئيسي: زر التصفح مستقل ومميّز، وتحته صف واحد من أزرار قصيرة */
.hub{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}
html .hub a.browse{display:flex;align-items:center;justify-content:center;gap:10px;padding:16px 12px;border-radius:16px;text-decoration:none;font-weight:700;font-size:1.25rem;color:#fff7de;background:linear-gradient(135deg,#0f5c4a,#16806a);border:1px solid #d9b45a;box-shadow:0 6px 20px rgba(15,92,74,.45),inset 0 -3px 0 #d9b45a;transition:transform .15s}
html .hub a.browse:hover{transform:translateY(-2px)}
.hub .quick{display:flex;gap:8px}
html .hub .qb{flex:1;display:flex;align-items:center;justify-content:center;white-space:nowrap;padding:9px 8px;border-radius:12px;border:1px solid var(--line);background:var(--card);color:var(--muted);font:600 .92rem 'Cairo',sans-serif;text-decoration:none;cursor:pointer;transition:all .2s}
html .hub .qb:hover{color:var(--ink);background:rgba(184,138,46,.12)}
html .hub .qb[hidden]{display:none}
html .hub #resume{color:var(--ink);border-color:#d9b45a;background:linear-gradient(to left,rgba(184,138,46,.2),var(--card))}
html .hub .qb[aria-selected=true]{background:linear-gradient(135deg,#0f5c4a,#16806a);color:#fff7de;border-color:#0f5c4a;box-shadow:inset 0 -3px 0 #d9b45a}
@media (max-width:700px){.hub .browse,.hub .q-search,.hub .q-count{display:none!important}.hub{margin-bottom:10px}}
.vc{text-align:center;color:var(--muted);font:600 .9rem 'Cairo',sans-serif;padding:6px 0 18px}
.vc[hidden]{display:none}
/* علامة القراءة على رقم الآية */
html .vn.bm{background:radial-gradient(circle,#e04a3a 0 62%,transparent 63%) center/contain no-repeat,var(--starClean) center/contain no-repeat!important;color:#fff!important;filter:drop-shadow(0 0 4px rgba(224,74,58,.75))}
/* شريط التطبيق السفلي (الجوال فقط) */
.appbar{display:none}
@media (max-width:700px){
  html,body{overflow-x:hidden}
  body{padding-bottom:calc(70px + env(safe-area-inset-bottom))}
  html .tabs.main,html .tabs.sub{display:none}
  .appbar{display:flex;position:fixed;inset:auto 0 0 0;z-index:900;background:rgba(8,32,27,.96);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-top:1px solid rgba(227,198,119,.55);padding:6px 6px calc(6px + env(safe-area-inset-bottom));box-shadow:0 -6px 18px rgba(0,0,0,.35)}
  .appbar a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 2px;border-radius:12px;color:#c9d6cf;text-decoration:none;font:600 .78rem/1.2 'Cairo',sans-serif;-webkit-tap-highlight-color:transparent}
  .appbar a b{font-size:1.3rem;line-height:1.1;font-weight:400}
  .appbar a[aria-current]{color:#fff7de;background:linear-gradient(135deg,#0f5c4a,#17806a);box-shadow:inset 0 -2px 0 #d9b45a}
  #toast{bottom:calc(84px + env(safe-area-inset-bottom))!important}
  html .nav button{min-width:0!important;padding:10px 12px!important}
  .nav input[type=range]{min-width:0}
}

/* تذييل: اعتماد التصميم */
.credit{text-align:center;padding:22px 16px 28px;font:600 .85rem 'Cairo',sans-serif;color:var(--muted)}
.credit a{color:var(--gold);font-weight:700;text-decoration:none;border-bottom:1px dotted var(--gold)}
.credit a:hover{filter:brightness(1.2)}
@media(max-width:700px){.credit{padding-bottom:calc(92px + env(safe-area-inset-bottom))}}
