/* ============================================================
   HalalFood — هوية أموية دمشقية
   رقّ المخطوطات + أخضر فسيفساء الجامع الأموي + نحاس عتيق
   (لا أسود + ذهب متدرج — تصميم أصيل لا قالب)
   ============================================================ */
:root {
  /* الأخضر الإسلامي الزمردي هو البطل (غلاف المصحف وقباب المساجد) */
  --bg: #0d3b32;
  --bg-deep: #092b24;
  --bg-elevated: #efe6cf;
  --bg-card: #fbf6ea;
  --border: #d8cbae;

  /* درجات الأخضر */
  --green: #155e52;
  --green-deep: #0e4a40;
  --teal: #2c8a7c;

  /* ذهب دافئ (زخارف المصاحف) */
  --copper: #c9a24b;
  --copper-light: #e0c274;
  --copper-dark: #9a7930;

  /* نصوص داخل البطاقات العاجية */
  --fg: #2a2f2c;
  --fg-muted: #5d665c;

  /* نصوص فوق الخلفية الخضراء مباشرة */
  --light: #f2ead6;
  --light-muted: #c9d6c6;

  /* أحكام (درجات ترابية دمشقية) */
  --halal: #1e7a4d;
  --haram: #a83226;
  --mushbooh: #a96b10;
  --unknown: #77716a;

  --radius: 14px;

  /* توافق خلفي مع الصفحات الثابتة القديمة */
  --gold: var(--copper);
  --gold-light: var(--copper-light);
  --gold-dark: var(--copper-dark);
  --border-gold: rgba(156, 107, 37, 0.35);

  /* نقش النجمة الثمانية — ذهبي خفي على الأخضر */
  --star-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23c9a24b' stroke-opacity='0.10' stroke-width='1.2'%3E%3Cpath d='M36 8 L44 28 L64 36 L44 44 L36 64 L28 44 L8 36 L28 28 Z'/%3E%3Cpath d='M36 18 L41 31 L54 36 L41 41 L36 54 L31 41 L18 36 L31 31 Z'/%3E%3Ccircle cx='36' cy='36' r='4'/%3E%3Cpath d='M0 0 L10 0 M0 0 L0 10 M72 0 L62 0 M72 0 L72 10 M0 72 L10 72 M0 72 L0 62 M72 72 L62 72 M72 72 L72 62'/%3E%3C/g%3E%3C/svg%3E");

  /* فاصل أرابيسك ذهبي */
  --arabesque: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='18' viewBox='0 0 220 18'%3E%3Cg fill='none' stroke='%23c9a24b' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M10 9 C 35 -3, 60 21, 85 9 S 135 -3, 160 9 S 200 21, 210 9'/%3E%3C/g%3E%3Cg fill='%23c9a24b'%3E%3Ccircle cx='110' cy='9' r='3'/%3E%3Cpath d='M110 2 L112 7 L117 9 L112 11 L110 16 L108 11 L103 9 L108 7 Z' fill-opacity='0.85'/%3E%3Ccircle cx='10' cy='9' r='2'/%3E%3Ccircle cx='210' cy='9' r='2'/%3E%3C/g%3E%3C/svg%3E");

  /* شريط فسيفساء (تسّرة الجامع الأموي) */
  --mosaic-band: repeating-linear-gradient(
    90deg,
    var(--green) 0 14px,
    var(--teal) 14px 22px,
    var(--copper) 22px 28px,
    var(--green-deep) 28px 42px,
    var(--copper-light) 42px 46px
  );
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Cairo", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
body {
  background-image: var(--star-tile);
  padding-bottom: 76px; /* مساحة للشريط السفلي */
}
::selection { background: var(--green); color: #fbf7ec; }

/* إصلاح علقة iOS (WKWebView): إلغاء انتظار النقرة المزدوجة + طبقة رسم مستقلة للعناصر الثابتة */
button, a, input, select, textarea, label {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button, a { cursor: pointer; }
button:active { transform: scale(0.97); transition: transform 0.05s ease; }
.bottomnav, header.top { transform: translateZ(0); will-change: transform; }

h1, h2, h3, .verdict-title, .logo span {
  font-family: "Amiri", "Cairo", Georgia, serif;
}

.hidden { display: none !important; }
.muted { color: var(--fg-muted); font-size: 0.9rem; }
.center { text-align: center; }
code {
  color: var(--copper-dark); background: rgba(156, 107, 37, 0.08);
  padding: 1px 7px; border-radius: 6px;
  font-size: 0.8rem; direction: ltr; unicode-bidi: embed;
}

/* ---------- الترويسة: أخضر عميق + شريط فسيفساء ---------- */
header.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px 15px;
  position: sticky; top: 0; z-index: 20;
  background: rgba(9, 43, 36, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: none;
}
header.top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: var(--mosaic-band);
  opacity: 0.85;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.3rem; }
.logo img { width: 36px; height: 36px; border-radius: 9px; }
.logo b { color: var(--copper-light); font-family: "Amiri", serif; font-weight: 700; }
.langs { display: flex; gap: 6px; }
.langs button {
  background: rgba(242, 234, 214, 0.08); color: var(--light-muted); border: 1px solid rgba(201, 162, 75, 0.35);
  border-radius: 999px; padding: 6px 13px; cursor: pointer; font-family: inherit; font-size: 0.8rem;
  min-height: 34px;
}
.langs button.active {
  color: var(--bg-deep); background: var(--copper); border-color: var(--copper-dark); font-weight: 700;
}

/* ---------- عام ---------- */
main { max-width: 640px; margin: 0 auto; padding: 20px 16px; }
.view { display: none; }
.view.active { display: block; animation: fadeUp 0.3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* البطل: قوس حدوة أموي يحتضن العنوان */
.hero { text-align: center; margin: 10px 0 22px; position: relative; padding-top: 8px; }
.hero::before {
  content: ""; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 300px; height: 150px; pointer-events: none; opacity: 0.65;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='150' viewBox='0 0 300 150'%3E%3Cg fill='none' stroke='%23c9a24b' stroke-width='2'%3E%3Cpath d='M40 150 L40 84 A 110 110 0 0 1 260 84 L260 150' stroke-opacity='0.55'/%3E%3Cpath d='M52 150 L52 86 A 98 98 0 0 1 248 86 L248 150' stroke-opacity='0.3'/%3E%3C/g%3E%3Cg fill='%23e0c274' fill-opacity='0.85'%3E%3Cpath d='M150 6 L154 16 L164 20 L154 24 L150 34 L146 24 L136 20 L146 16 Z'/%3E%3C/g%3E%3C/svg%3E") center top no-repeat;
}
.hero .badge {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(201, 162, 75, 0.45); background: rgba(201, 162, 75, 0.12);
  color: var(--copper-light); border-radius: 999px; padding: 6px 16px;
  font-size: 0.78rem; letter-spacing: 0.1em; font-weight: 700;
}
.hero .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--copper-light); }
.hero h1 { position: relative; font-size: 1.9rem; margin-top: 14px; font-weight: 700; color: var(--light); }
.hero p.muted { color: var(--light-muted); }
.hero h1::after {
  content: ""; display: block; width: 220px; height: 18px; margin: 8px auto 0;
  background: var(--arabesque) center / contain no-repeat;
}
.hero p { position: relative; margin-top: 8px; }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-top: 16px;
  box-shadow: 0 2px 10px rgba(90, 70, 30, 0.06);
}

/* ---------- الماسح ---------- */
.cam-wrap { position: relative; border-radius: 12px; overflow: hidden; margin-bottom: 14px; border: 2px solid var(--green); background: #10201c; }
.cam-wrap video { width: 100% !important; display: block; max-height: 320px; object-fit: cover; background: #10201c; }
#camReader { width: 100%; }
.scan-line {
  position: absolute; left: 8%; right: 8%; height: 2px; top: 20%;
  background: linear-gradient(90deg, transparent, #7fd6c8, transparent);
  box-shadow: 0 0 12px #7fd6c8; animation: scanmove 2.2s ease-in-out infinite;
}
@keyframes scanmove { 50% { top: 78%; } }

.btn {
  display: block; width: 100%; border: none; border-radius: 12px;
  padding: 13px 18px; font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
  min-height: 48px;
  transition: filter 0.18s, transform 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn.gold { /* الاسم تاريخي — الزر الرئيسي أخضر أموي */
  background: linear-gradient(180deg, var(--green), var(--green-deep));
  color: #f6f0e2;
  border: 1px solid var(--green-deep);
  box-shadow: 0 3px 12px rgba(14, 74, 64, 0.25);
}
.btn.gold:hover { filter: brightness(1.08); }
.btn.outline { background: transparent; border: 1.5px solid var(--green); color: var(--green-deep); }
.btn.outline:hover { background: rgba(21, 94, 82, 0.07); }
.btn:disabled { opacity: 0.45; cursor: default; }

.or { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--fg-muted); font-size: 0.8rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.manual { display: flex; gap: 8px; }
.manual input {
  flex: 1; background: #fff; border: 1px solid var(--border); color: var(--fg);
  border-radius: 12px; padding: 12px 14px; font-family: inherit; font-size: 1rem; min-width: 0;
  min-height: 48px;
}
.manual input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(21, 94, 82, 0.15); }
.manual .btn { width: auto; padding-inline: 22px; }

input, textarea, select {
  font-family: inherit;
}
#modalBox input, #modalBox textarea {
  width: 100%; background: #fff; border: 1px solid var(--border); color: var(--fg);
  border-radius: 10px; padding: 11px 13px; font-size: 0.95rem;
}
#modalBox input:focus, #modalBox textarea:focus { outline: none; border-color: var(--green); }

/* ---------- النتيجة ---------- */
.result { border-width: 1px; position: relative; overflow: hidden; }
.result::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.result.v-halal { border-color: rgba(30, 122, 77, 0.5); }
.result.v-halal::before { background: var(--halal); }
.result.v-haram { border-color: rgba(168, 50, 38, 0.55); }
.result.v-haram::before { background: var(--haram); }
.result.v-mushbooh { border-color: rgba(169, 107, 16, 0.55); }
.result.v-mushbooh::before { background: var(--mushbooh); }
.result.v-unknown::before { background: var(--unknown); }

.verdict-row { display: flex; gap: 14px; align-items: flex-start; }
.verdict-icon { font-size: 2.2rem; line-height: 1; }
.verdict-title { font-size: 1.7rem; font-weight: 700; }
.v-halal .verdict-title { color: var(--halal); }
.v-haram .verdict-title { color: var(--haram); }
.v-mushbooh .verdict-title { color: var(--mushbooh); }
.v-unknown .verdict-title { color: var(--unknown); }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  font-size: 0.72rem; border-radius: 999px; padding: 3px 11px;
  border: 1px solid var(--border); background: var(--bg-elevated); color: var(--fg-muted);
}
.chip.st-verified { border-color: rgba(30, 122, 77, 0.5); color: var(--halal); background: rgba(30, 122, 77, 0.07); }
.chip.st-community { border-color: rgba(156, 107, 37, 0.5); color: var(--copper-dark); background: rgba(156, 107, 37, 0.07); }
.chip.st-label { border-color: rgba(30, 122, 77, 0.4); color: var(--halal); }

.conf-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 0.85rem; }
.conf { flex: 1; height: 8px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.conf-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--green)); transition: width 0.5s ease; }

.prod { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 12px; background: var(--bg-elevated); border-radius: 12px; }
.prod img { width: 58px; height: 58px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--border); }
.prod div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.admin-note {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: rgba(21, 94, 82, 0.06); border-inline-start: 3px solid var(--green);
}
.admin-note b { font-size: 0.85rem; color: var(--green-deep); }
.admin-note p { font-size: 0.85rem; color: var(--fg-muted); margin-top: 4px; }

.result h3 { margin-top: 20px; font-size: 1.15rem; color: var(--green-deep); }
.result h3::after {
  content: ""; display: block; width: 120px; height: 10px; margin-top: 2px;
  background: var(--arabesque) right center / 160px no-repeat; opacity: 0.6;
}
html[dir="ltr"] .result h3::after { background-position: left center; }

.reasons { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.reason { display: flex; gap: 10px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid var(--border); border-inline-start: 3px solid var(--border); }
.reason.r-haram { border-inline-start-color: var(--haram); }
.reason.r-mushbooh { border-inline-start-color: var(--mushbooh); }
.reason.r-exception { border-inline-start-color: var(--halal); }
.reason.r-info { border-inline-start-color: var(--teal); }
.reason.r-ai { border-inline-start-color: var(--copper); }
.reason b { font-size: 0.9rem; }
.reason p { font-size: 0.83rem; color: var(--fg-muted); margin-top: 3px; line-height: 1.65; }

/* البدائل الموثوقة */
.alt-hint { font-size: 0.78rem; margin-top: 2px; }
.alts { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.alt-item {
  padding: 12px 14px; border-radius: 12px;
  background: rgba(21, 94, 82, 0.05); border: 1px solid rgba(21, 94, 82, 0.25);
}
.alt-item b { color: var(--green-deep); font-size: 0.9rem; }
.alt-item p { font-size: 0.8rem; color: var(--fg-muted); margin-top: 3px; }

/* المجتمع */
.community { margin-top: 18px; padding-top: 4px; }
.nc-row { display: flex; gap: 8px; margin: 8px 0; }
.nc-hint { font-size: 0.75rem; }
.community .btn { margin-top: 10px; }

details { margin-top: 14px; }
details summary { cursor: pointer; color: var(--green-deep); font-size: 0.87rem; font-weight: 700; }
.ing { margin-top: 8px; font-size: 0.8rem; color: var(--fg-muted); line-height: 1.7; }
.src-list { margin: 8px 0 0 0; padding-inline-start: 18px; font-size: 0.78rem; }
.src-list a { color: var(--green); }

.loading-card { text-align: center; }
.spinner {
  width: 36px; height: 36px; margin: 6px auto 12px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--green); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.enrich-btn { margin-top: 14px; }
.quota-chip { margin-top: 14px; text-align: center; font-size: 0.75rem; color: var(--fg-muted); }
.quota-chip b { color: var(--copper-dark); }

.disclaimer { margin-top: 18px; font-size: 0.72rem; color: var(--light-muted); line-height: 1.7; text-align: center; opacity: 0.9; }

/* ---------- المكتبة ---------- */
#view-library h2, #view-lists h2 { font-size: 1.35rem; margin: 8px 0 14px; color: var(--light); }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.stat { font-size: 0.75rem; color: var(--fg-muted); background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; padding: 5px 13px; }
.stat b { color: var(--fg); }
.stat.c-halal b { color: var(--halal); }
.stat.c-haram b { color: var(--haram); }
.stat.c-mushbooh b { color: var(--mushbooh); }
.stat.c-verified b { color: var(--copper-dark); }

.search {
  width: 100%; background: #fff; border: 1px solid var(--border); color: var(--fg);
  border-radius: 12px; padding: 12px 14px; font-family: inherit; font-size: 0.95rem; min-height: 48px;
}
.search:focus { outline: none; border-color: var(--green); }

.lib-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.lib-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; color: var(--fg); font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s; min-height: 56px;
}
.lib-item:hover { border-color: var(--green); box-shadow: 0 2px 8px rgba(21, 94, 82, 0.12); }
.lib-item .li-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lib-item .li-main b { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-item .li-main small { color: var(--fg-muted); font-size: 0.75rem; }
.dot { font-size: 1.1rem; }

/* ---------- قوائمي ---------- */
.list-section { margin-top: 16px; }
.list-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.1rem; padding: 10px 14px; border-radius: 12px 12px 0 0;
  border: 1px solid var(--border); border-bottom: none; background: var(--bg-elevated);
}
.list-head.lh-halal { color: var(--halal); border-inline-start: 4px solid var(--halal); }
.list-head.lh-haram { color: var(--haram); border-inline-start: 4px solid var(--haram); }
.list-head .chip { margin-inline-start: auto; }
.list-section .lib-list { margin-top: 0; gap: 0; }
.list-section .lib-item { border-radius: 0; border-top: none; }
.list-section .lib-item:last-child { border-radius: 0 0 12px 12px; }
.lists-teaser .verdict-icon { font-size: 2.6rem; margin-bottom: 6px; }
.lists-teaser h3 { color: var(--green-deep); margin-bottom: 6px; }

/* ---------- الحساب ---------- */
.acc-hello { font-size: 1.2rem; color: var(--green-deep); margin-bottom: 6px; }
.plan { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.plan-premium { color: var(--copper-dark); }
.upgrade {
  margin: 14px 0; padding: 14px; border-radius: 12px;
  background: rgba(156, 107, 37, 0.07); border: 1px solid rgba(156, 107, 37, 0.35);
}
.upgrade b { color: var(--copper-dark); }
.upgrade p { margin-top: 6px; font-size: 0.83rem; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.auth-tabs button {
  flex: 1; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--fg-muted);
  border-radius: 10px; padding: 10px; font-family: inherit; font-weight: 700; cursor: pointer; min-height: 44px;
}
.auth-tabs button.active { background: var(--green); color: #f6f0e2; border-color: var(--green-deep); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input {
  background: #fff; border: 1px solid var(--border); color: var(--fg);
  border-radius: 10px; padding: 12px 14px; font-family: inherit; font-size: 0.95rem; min-height: 48px;
}
.auth-form input:focus { outline: none; border-color: var(--green); }
.auth-err { color: var(--haram); font-size: 0.8rem; min-height: 1em; }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-inline-end: 46px; }
.pw-eye {
  position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1.15rem;
  min-width: 40px; min-height: 40px; line-height: 1;
}
.admin-link { text-align: center; text-decoration: none; margin-bottom: 10px; display: block; }
.forgot-link {
  background: none; border: none; cursor: pointer; font-family: inherit;
  color: var(--copper-dark); font-size: 0.85rem; text-decoration: underline;
  padding: 6px; min-height: 40px;
}
#fgStep2 { display: flex; flex-direction: column; gap: 10px; }

/* أدوات الكاميرا: فلاش + زوم + التقاط يدوي */
.cam-controls {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-wrap: wrap; margin: 10px 0 4px;
}
.cam-ctl {
  border: 1.5px solid var(--border); background: #fff; border-radius: 12px;
  padding: 10px 14px; font-family: inherit; font-size: 1.05rem; min-height: 44px;
}
.cam-ctl.on { background: var(--copper); border-color: var(--copper-dark); box-shadow: 0 0 12px rgba(201, 162, 75, 0.5); }
.cam-ctl.cam-manual { font-size: 0.85rem; font-weight: 700; color: var(--copper-dark); border-color: var(--copper); }
.cam-zoom-wrap { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 130px; max-width: 220px; }
.cam-zoom { flex: 1; accent-color: var(--copper); min-height: 34px; }

/* فحص صورة المكونات */
.photo-scan-btn { margin-top: 10px; width: 100%; }
.ocr-box { margin-top: 10px; background: rgba(156, 107, 37, 0.06); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.ocr-box summary { cursor: pointer; font-size: 0.85rem; font-weight: 700; color: var(--copper-dark); }
.ocr-box p { font-size: 0.82rem; margin-top: 8px; line-height: 1.7; color: var(--fg-muted, #5d665c); }
.photo-scan-note { font-size: 0.78rem; margin-top: 10px; }

/* دليل المحلات الحلال */
.deals-sub { font-size: 0.85rem; margin-bottom: 14px; }
.deal-card {
  background: #fbf6ea; border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; margin-bottom: 14px; cursor: pointer; transition: border-color .15s;
}
.deal-card:hover { border-color: var(--copper); }
.deal-photo { width: 100%; height: 170px; object-fit: cover; display: block; background: #fff; }
.deal-noimg { display: flex; align-items: center; justify-content: center; font-size: 3rem; background: var(--bg-deep, #092b24); color: #c9a24b; }
.deal-body { padding: 13px 15px; }
.deal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.deal-head b { font-size: 1.05rem; }
.deal-badge {
  font-size: 0.62rem; font-weight: 700; color: var(--copper-dark);
  border: 1px solid rgba(156, 107, 37, 0.5); border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.deal-loc { font-size: 0.8rem; margin: 4px 0; }
.deal-note { font-size: 0.85rem; margin: 6px 0; }
.deal-call { display: inline-flex; gap: 6px; margin-top: 6px; font-size: 0.85rem; padding: 9px 16px; }
.deal-modal-img { width: 100%; border-radius: 12px; border: 1px solid var(--border); margin: 5px 0; display: block; background: #fff; }
.deals-empty { text-align: center; font-size: 2.2rem; padding: 30px 16px; }
.deals-empty p { font-size: 0.9rem; margin-top: 8px; }
.advertise-link { display: block; text-align: center; text-decoration: none; margin-top: 6px; }
@media (min-width: 768px) { #dealsList { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .deal-card { margin-bottom: 0; } }

/* باقات الاشتراك */
.plans { margin: 14px 0; }
.plans-title { color: var(--copper-dark); font-size: 1.15rem; margin-bottom: 10px; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-card {
  position: relative; text-align: center; padding: 16px 12px;
  background: #fff; border: 1.5px solid var(--border); border-radius: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.plan-card.plan-best { border-color: var(--copper); background: rgba(156, 107, 37, 0.05); }
.plan-save {
  position: absolute; top: -10px; inset-inline-end: 10px;
  background: var(--copper); color: #fff; font-size: 0.65rem; font-weight: 700;
  border-radius: 999px; padding: 2px 10px;
}
.plan-card b { color: var(--green-deep); font-size: 0.95rem; }
.plan-price { font-size: 1.5rem; font-weight: 800; color: var(--fg); font-family: "Amiri", serif; }
.plan-price small { font-size: 0.7rem; color: var(--fg-muted); font-family: "Cairo", sans-serif; display: block; }
.plan-card .btn { min-height: 44px; padding: 9px 10px; font-size: 0.9rem; }
.plan-features { font-size: 0.78rem; margin: 12px 0; line-height: 1.7; }
.iap-legal { font-size: 0.68rem; line-height: 1.7; margin-top: 10px; opacity: 0.85; }
.iap-legal a { color: var(--green-deep); }
.manage-note { margin: 10px 0; font-size: 0.82rem; }
#restoreBtn { margin-top: 4px; }
.delete-account {
  margin-top: 16px; background: none; border: none; cursor: pointer;
  color: var(--haram); font-family: inherit; font-size: 0.78rem; opacity: 0.8;
  min-height: 44px; width: 100%;
}

/* ---------- النوافذ ---------- */
#modal {
  position: fixed; inset: 0; background: rgba(42, 47, 44, 0.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
#modalBox {
  background: var(--bg-card); border: 1px solid var(--border); border-top: 4px solid var(--green);
  border-radius: 16px; padding: 22px; width: 100%; max-width: 480px; max-height: 88vh; overflow: auto;
  display: flex; flex-direction: column; gap: 10px;
}
#modalBox h3 { color: var(--green-deep); font-size: 1.2rem; }
.stance-row { display: flex; flex-direction: column; gap: 8px; }
.stance {
  background: #fff; border: 1px solid var(--border); color: var(--fg);
  border-radius: 10px; padding: 11px; font-family: inherit; cursor: pointer; text-align: start; min-height: 44px;
}
.stance.active { border-color: var(--green); background: rgba(21, 94, 82, 0.07); font-weight: 700; }
.file-label { font-size: 0.85rem; color: var(--fg-muted); display: flex; flex-direction: column; gap: 8px; }
.file-label input { border: 1px dashed var(--copper); border-radius: 10px; padding: 10px; background: rgba(156, 107, 37, 0.04); }
.photo-state { font-size: 0.8rem; min-height: 1.2em; }
.stars { display: flex; gap: 6px; justify-content: center; }
.stars button { background: none; border: none; font-size: 2rem; cursor: pointer; color: var(--copper); min-width: 44px; min-height: 44px; }

/* ---------- الشريط السفلي والتذييل ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; background: rgba(9, 43, 36, 0.96); backdrop-filter: blur(10px);
  border-top: none;
}
.bottomnav::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--mosaic-band); opacity: 0.9;
}
.bottomnav button {
  flex: 1; background: none; border: none; color: var(--light-muted); font-family: inherit;
  padding: 12px 8px 14px; font-size: 0.82rem; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; align-items: center; min-height: 56px;
}
.bottomnav button.active { color: var(--copper-light); font-weight: 700; }
.bottomnav button.active span { border-bottom: 2px solid var(--copper-light); }

footer { max-width: 640px; margin: 30px auto 0; padding: 0 16px 20px; text-align: center; }
footer::before {
  content: ""; display: block; width: 220px; height: 18px; margin: 0 auto 14px;
  background: var(--arabesque) center / contain no-repeat; opacity: 0.55;
}
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-bottom: 12px; }
footer a { color: var(--light-muted); text-decoration: none; font-size: 0.8rem; }
footer a:hover { color: var(--copper-light); }
.copy { font-size: 0.7rem; color: var(--light-muted); opacity: 0.75; }

.toast {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--green-deep); border: 1px solid var(--green); color: #f6f0e2;
  border-radius: 12px; padding: 11px 20px; font-size: 0.85rem; box-shadow: 0 8px 30px rgba(20, 40, 35, 0.35);
  max-width: 90vw; text-align: center;
}

/* ---------- تجاوب: تابلت فأكبر ---------- */
@media (min-width: 700px) {
  .hero h1 { font-size: 2.4rem; }
}
@media (min-width: 768px) {
  main { max-width: 760px; }
  footer { max-width: 760px; }
  /* المكتبة شبكة عمودين */
  .lib-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .lib-list .lib-item { min-width: 0; } /* الأسماء الطويلة لا تُخل بتساوي الأعمدة */
  .list-section .lib-list { display: flex; flex-direction: column; }
  /* الشريط السفلي أزرار متمركزة */
  .bottomnav { justify-content: center; gap: 8px; }
  .bottomnav button { flex: 0 0 170px; }
}
@media (min-width: 900px) {
  /* قوائمي: الحلال وغير الحلال جنباً إلى جنب */
  #listsBox { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  #listsBox > .card, #listsBox > p { grid-column: 1 / -1; }
  .list-section { margin-top: 8px; }
}
@media (min-width: 1024px) {
  main { max-width: 860px; }
}

/* روابط مصادر التحقق العميق */
.src-link { display: inline-block; font-size: 0.78rem; color: var(--copper-dark); margin: 4px 8px 0 0; text-decoration: underline; }

/* الدليل: تبديل المحلات/المساجد + بطاقات المساجد */
.guide-seg { display: flex; gap: 6px; background: rgba(0, 0, 0, 0.18); padding: 4px; border-radius: 12px; margin-bottom: 14px; }
.guide-seg button { flex: 1; border: 0; background: transparent; color: var(--light-muted); font: inherit; font-weight: 700; padding: 9px; border-radius: 9px; }
.guide-seg button.active { background: var(--bg-card); color: var(--green-deep); }
.mq-pickers { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-bottom: 12px; }
.mq-pickers select { width: 100%; padding: 11px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-card); color: var(--fg); font: inherit; font-size: 0.9rem; }
.mq-card { margin-bottom: 10px; }
.mq-card p { font-size: 0.84rem; margin-top: 4px; }
.mq-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mq-actions .btn { width: auto; flex: 1; min-width: 110px; padding: 9px 12px; font-size: 0.85rem; margin: 0; }
.mq-n { font-size: 0.8rem; margin-bottom: 8px; }
.mq-attr { font-size: 0.72rem; margin-top: 14px; text-align: center; }

/* شريط الرجوع/الرئيسية — الموقع العام والصفحات الثابتة */
.pagebar { max-width: 980px; margin: 0 auto; padding: 12px 16px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pagebar a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 10px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .88rem; color: var(--light); border: 1px solid rgba(224, 194, 116, .35); background: rgba(9, 43, 36, .45); transition: background .15s ease, border-color .15s ease; }
.pagebar a:hover { border-color: var(--copper-light); background: rgba(224, 194, 116, .1); }
.pagebar a:active { transform: scale(.97); }
.pagebar svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--copper-light); }
[dir="rtl"] .pagebar .pb-back svg { transform: scaleX(-1); }
.pagebar .pb-home { padding: 0 14px; }
