/* كِتي — نظام التصميم: البنية + الثيم الفاتح «كريمي مشمشي» (cream).
   الثيم الافتراضي للموقع هو الداكن (theme-dark.css) ويُحمَّل بعد هذا الملف ويبدّل الرموز فقط.
   الخط: Tajawal (مضمّن محليًا). Thmanyah غير موجود في المستودع بترخيص، لذلك لم يُستخدم.
   كل لون نص مُتحقَّق منه ≥ 4.5:1 على خلفيته، وحدود الحقول وحلقة التركيز ≥ 3:1. */

@font-face { font-family: "Tajawal"; src: url("/static/fonts/Tajawal-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("/static/fonts/Tajawal-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  /* الأسطح (من الأبعد إلى الأقرب) */
  --bg: #FFF8F0;
  --surface: #FFFFFF;
  --surface-2: #FFF0E2;
  --surface-3: #FFE4CF;
  --header-bg: rgba(255, 255, 255, .9);
  --ink: #2A1C12;
  --mute: #6A5444;
  --line: #EFDCC8;
  --field-border: #9A7B63;
  /* العلامة */
  --brand: #A8451A;
  --on-brand: #FFFFFF;
  --brand-hover: #8A3714;
  --brand-soft: #FFE4CF;
  --brand-ink: #93391A;
  --accent: #F7B477;
  --on-accent: #2A1C12;
  --glow: rgba(168, 69, 26, .35);
  /* الحالات */
  --ok-bg: #E2F3E5;   --ok-ink: #1C5A2D;
  --done-bg: #FFF0C2; --done-ink: #634700;
  --warn-bg: #FFF1D6; --warn-ink: #6B4500;
  --err-bg: #FDE7E2;  --err-ink: #9E2A12; --err-line: #D9583A;
  --info-bg: #E8F0FB; --info-ink: #1D4677;
  --muted-bg: #F1EAE2; --muted-ink: #594A3E;
  --danger: #9E2A12;  --on-danger: #FFFFFF; --danger-hover: #7A1F0C;
  --focus: #1B4F9C;
  --wa: #25D366;      --on-wa: #062D15; --wa-hover: #1FBF5B;
  /* الشكل */
  --radius: 20px;
  --radius-sm: 12px;
  --bw: 1px;
  --shadow: 0 1px 2px rgba(42, 28, 18, .06), 0 6px 18px -12px rgba(42, 28, 18, .25);
  --shadow-lg: 0 20px 40px -24px rgba(42, 28, 18, .45);
  --btn-shadow: none;
  --tap: 48px;
  --s1: 6px; --s2: 10px; --s3: 16px; --s4: 24px; --s5: 36px; --s6: 56px;
  --container: 1120px;
  --font: "Tajawal", system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
}

/* ── الأساس ──────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.75;
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-ink); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 var(--s2); }
h1 { font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.4px; }
h2 { font-size: 23px; }
h3 { font-size: 19px; }
p { margin: 0 0 var(--s2); }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
[hidden] { display: none !important; }
::placeholder { color: var(--mute); opacity: 1; }
::selection { background: var(--brand); color: var(--on-brand); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; inset-inline-start: var(--s3); top: -100px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: var(--s2); color: var(--bg); }
main:focus { outline: none; }
.muted { color: var(--mute); }

.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s3) var(--s6); flex: 1; }

/* ── الترويسة (لاصقة ومضغوطة) ───────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
}
.top__in {
  position: relative; max-width: var(--container); margin: 0 auto; padding: 6px var(--s3);
  display: flex; align-items: center; gap: var(--s1); min-height: 60px;
}
.logo { display: inline-flex; align-items: center; gap: var(--s2); text-decoration: none; color: var(--ink); min-height: var(--tap); margin-inline-end: auto; }
.logo:hover { color: var(--ink); }
.logo__mark { width: 38px; height: 38px; border-radius: 50%; }
.logo__word { font-weight: 700; font-size: 25px; line-height: 1; }
.logo__latin { font-size: 12px; color: var(--mute); font-weight: 700; letter-spacing: .5px; align-self: flex-end; padding-bottom: 8px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 50%; color: var(--ink); background: transparent; border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.theme-toggle--to-light { display: none; }

/* القائمة: تعمل بلا JS عبر خانة اختيار مخفية */
.nav-toggle { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.nav-btn { order: 3; }
.nav-btn__close { display: none; }
.nav-toggle:checked ~ .nav-btn { background: var(--surface-2); border-color: var(--line); }
.nav-toggle:checked ~ .nav-btn .nav-btn__open { display: none; }
.nav-toggle:checked ~ .nav-btn .nav-btn__close { display: block; }
.nav-toggle:focus-visible ~ .nav-btn { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-toggle { order: 2; }
.nav {
  display: none; position: absolute; top: 100%; inset-inline: 0;
  padding: var(--s2) var(--s3) var(--s3); gap: var(--s1);
  background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.nav-toggle:checked ~ .nav { display: grid; animation: drop .18s ease both; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.nav__link {
  display: flex; align-items: center; min-height: 48px; padding: 4px var(--s3); border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 17px;
}
.nav__link:hover { background: var(--surface-2); color: var(--ink); }
.nav__link[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); }
.nav__link--cta { background: var(--brand); color: var(--on-brand); justify-content: center; }
.nav__link--cta:hover, .nav__link--cta[aria-current="page"] { background: var(--brand-hover); color: var(--on-brand); }
@media (min-width: 800px) {
  .top__in { min-height: 68px; gap: var(--s2); }
  .nav-btn, .nav-toggle { display: none; }
  .nav, .nav-toggle:checked ~ .nav {
    display: flex; position: static; padding: 0; gap: 4px; background: none; border: 0; box-shadow: none; animation: none; order: 1;
  }
  .nav__link { min-height: 44px; padding: 4px 16px; border-radius: 999px; font-size: 16px; }
  .nav__link--cta { padding-inline: 22px; margin-inline-start: 6px; }
}

/* ── التذييل ─────────────────────────────────────────────────────── */
.foot { background: var(--surface); border-top: 1px solid var(--line); text-align: center; padding: var(--s4) var(--s3); color: var(--mute); font-size: 15px; }
.foot__nav { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--s1) var(--s3); margin-bottom: var(--s2); }
.foot__nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s2); font-weight: 700; color: var(--ink); }
.foot__fine { font-size: 14px; }

/* ── الأزرار ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 8px 22px;
  font: inherit; font-weight: 700; line-height: 1.3; text-decoration: none; text-align: center;
  background: var(--surface); color: var(--ink);
  border: var(--bw) solid var(--field-border); border-radius: 999px;
  box-shadow: var(--btn-shadow); cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover { color: var(--ink); background: var(--surface-2); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.btn.is-loading { cursor: progress; }
.btn--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); box-shadow: 0 8px 20px -12px var(--glow); }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.btn--secondary { background: transparent; color: var(--brand-ink); border-color: var(--brand); }
.btn--secondary:hover { background: var(--brand-soft); color: var(--brand-ink); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; box-shadow: none; }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger); color: var(--on-danger); border-color: var(--danger); }
.btn--danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: var(--on-danger); }
.btn--danger-ghost { background: transparent; color: var(--err-ink); border-color: var(--err-line); }
.btn--danger-ghost:hover { background: var(--err-bg); color: var(--err-ink); }
.btn--wa { background: var(--wa); color: var(--on-wa); border-color: var(--wa); box-shadow: 0 8px 20px -12px rgba(37, 211, 102, .6); }
.btn--wa:hover { background: var(--wa-hover); color: var(--on-wa); }
.btn--google { background: #FFFFFF; color: #1F1F1F; border: 1px solid #747775; }
.btn--google span { font-weight: 700; font-size: 18px; color: #1A73E8; font-family: system-ui, sans-serif; }
.btn--google:hover { background: #F2F2F2; color: #1F1F1F; }
.btn--big { min-height: 54px; padding: 10px 30px; font-size: 18px; }
.btn--sm { min-height: 44px; padding: 6px 16px; font-size: 15px; }
.btn--block { width: 100%; }
.is-loading::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-inline-end-color: transparent; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cta-row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.cta-row--center { justify-content: center; }
.inline-form { display: inline; margin: 0; }
.inline-form .btn { width: auto; }

/* ── شارات وتنبيهات ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 2px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; line-height: 1.7;
  background: var(--muted-bg); color: var(--muted-ink);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge--done { background: var(--done-bg); color: var(--done-ink); }
.badge--warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge--danger { background: var(--err-bg); color: var(--err-ink); }
.badge--muted { background: var(--muted-bg); color: var(--muted-ink); }

.alert {
  border-radius: var(--radius-sm); padding: var(--s3); margin: 0 auto var(--s3); max-width: 760px;
  border: 1px solid transparent; border-inline-start-width: 5px;
  background: var(--info-bg); color: var(--info-ink); border-color: var(--info-ink);
}
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert ul { margin: 6px 0 0; padding-inline-start: 22px; }
.alert__title { font-weight: 700; }
.alert--err { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-line); }
.alert--ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-ink); }
.alert--warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-ink); }
.alert:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.alert-actions { max-width: 760px; margin: calc(-1 * var(--s2)) auto var(--s3); }

.note { color: var(--mute); font-size: 15px; line-height: 1.7; margin: var(--s2) 0 0; }
.fine { color: var(--mute); font-size: 14px; }

.empty {
  text-align: center; background: var(--surface); border: 1px dashed var(--field-border);
  border-radius: var(--radius); padding: var(--s5) var(--s3); margin: var(--s3) 0;
}
.empty__art { width: 168px; height: 126px; margin: 0 auto var(--s2); }
.empty h2 { margin: 0 0 6px; }
.empty p { color: var(--mute); margin: 0 auto var(--s3); max-width: 42ch; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); box-shadow: var(--shadow); }
.card--narrow { max-width: 760px; margin-inline: auto; }
.card__title { font-size: 30px; }

/* ── رؤوس الصفحات ───────────────────────────────────────────────── */
.page-head { margin: var(--s4) 0 var(--s3); }
.page-head h1 { margin-bottom: 4px; }
.page-head p { color: var(--mute); margin: 0; max-width: 60ch; }
.page-head--narrow { max-width: 760px; margin-inline: auto; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-top: var(--s2); font-weight: 700; text-decoration: none; color: var(--mute); }
.back:hover { color: var(--ink); text-decoration: underline; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); margin: var(--s6) 0 var(--s3); }
.sec-head h2 { margin: 0; font-size: clamp(22px, 3.4vw, 28px); }
.sec-head a { font-weight: 700; display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.sec-title { margin-top: var(--s4); }

/* ── الرئيسية ────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden; display: grid; gap: var(--s3); align-items: center;
  margin: var(--s3) 0 var(--s4); padding: var(--s5) var(--s4);
  background: radial-gradient(120% 140% at 0% 0%, var(--surface-3) 0%, var(--surface-2) 45%, var(--surface) 100%);
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 8px);
}
.hero__kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: var(--s2); padding: 2px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--brand-ink); font-weight: 700; font-size: 14px; }
.hero h1 { font-size: clamp(34px, 7.4vw, 58px); line-height: 1.18; margin-bottom: var(--s2); letter-spacing: -1px; }
.hero .hl { color: var(--brand-ink); }
.hero p { color: var(--mute); font-size: 18px; max-width: 46ch; margin-bottom: var(--s4); }
.hero p.hero__fine { font-size: 14px; margin: var(--s3) 0 0; }
.hero__art { width: min(62%, 240px); height: auto; margin: 0 auto; order: -1; }
@media (min-width: 800px) {
  .hero { grid-template-columns: 1.25fr .75fr; padding: var(--s6) var(--s5); }
  .hero__art { width: min(100%, 340px); order: 0; }
}
.how__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.how__list li {
  display: flex; gap: var(--s3); align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4);
}
.how__list p { margin: 0; color: var(--mute); }
.how__list strong { display: block; color: var(--ink); font-size: 18px; }
.how__n {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 19px;
}
@media (min-width: 800px) { .how__list { grid-template-columns: repeat(3, 1fr); gap: var(--s3); } .how__list li { flex-direction: column; } }

.trust { display: grid; gap: var(--s2); grid-template-columns: 1fr 1fr; list-style: none; margin: 0; padding: 0; }
.trust li {
  display: grid; gap: 4px; align-content: start; padding: var(--s3);
  background: var(--surface-2); border-radius: var(--radius-sm); font-size: 15px; color: var(--mute); line-height: 1.6;
}
.trust strong { color: var(--ink); font-size: 16px; }
.trust svg { width: 26px; height: 26px; color: var(--brand-ink); }
@media (min-width: 800px) { .trust { grid-template-columns: repeat(4, 1fr); gap: var(--s3); } }

.cta-band {
  display: grid; gap: var(--s3); align-items: center; margin-top: var(--s6); padding: var(--s4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.cta-band h2 { margin: 0 0 4px; }
.cta-band p { margin: 0; color: var(--mute); }
@media (min-width: 800px) { .cta-band { grid-template-columns: 1fr auto; padding: var(--s5); } }

/* ── بطاقات القطط ───────────────────────────────────────────────── */
.cat-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
@media (max-width: 599px) and (min-width: 360px) { .cat-grid { grid-template-columns: 1fr 1fr; gap: var(--s2); } }
.cat-card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cat-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.cat-card:focus-visible { outline-offset: 3px; border-radius: var(--radius); }
.cat-card__media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.cat-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.cat-card:hover .cat-card__media img { transform: scale(1.04); }
.cat-card__media .badge { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.cat-card__body { display: block; padding: var(--s2) var(--s3) var(--s3); }
.cat-card__body h3 { margin: 0 0 2px; font-size: 20px; }
.meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0; color: var(--mute); font-size: 14px; line-height: 1.6; }
.meta li:not(:last-child)::after { content: "،"; margin-inline: 0 6px; }
.cat-card--adopted .cat-card__media img { filter: saturate(.55); }
.ph { display: block; width: 100%; height: 100%; background: var(--surface-2) url("/static/img/cat-ph.svg") center / 62% auto no-repeat; }
.ph--big { min-height: 260px; background-size: auto 70%; }
@media (min-width: 600px) { .cat-card__body { padding: var(--s3); } .cat-card__body h3 { font-size: 22px; } .meta { font-size: 15px; } .cat-card__media .badge { inset-block-start: 10px; inset-inline-start: 10px; } }

/* ── الفلاتر ─────────────────────────────────────────────────────── */
.filters {
  display: grid; gap: var(--s2); margin-bottom: var(--s3); padding: var(--s3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.filters__search { display: flex; gap: var(--s2); }
.filters__search input { flex: 1; min-width: 0; }
.filters__more > summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 var(--s3); cursor: pointer;
  border: 1px solid var(--field-border); border-radius: 999px; font-weight: 700; list-style: none; user-select: none;
}
.filters__more > summary::-webkit-details-marker { display: none; }
.filters__more > summary::after { content: "▾"; font-size: 13px; transition: transform .15s ease; }
.filters__more[open] > summary::after { transform: rotate(180deg); }
.filters__more > summary:hover { background: var(--surface-2); }
.filters__more.is-static > summary { display: none; }
.filters__body { display: grid; gap: var(--s3); padding-top: var(--s3); }
.filters__more.is-static .filters__body { padding-top: var(--s1); }
.filters__grid { display: grid; gap: var(--s2) var(--s3); grid-template-columns: 1fr 1fr; }
.filters__foot { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.filters__actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-inline-start: auto; }
@media (min-width: 900px) { .filters__grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 480px) { .filters__actions { margin-inline-start: 0; width: 100%; } .filters__actions .btn { flex: 1; } }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 16px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--field-border); border-radius: 999px; font-weight: 700; font-size: 15px;
}
.toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.toggle:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.toggle:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.pill-n { background: var(--brand); color: var(--on-brand); border-radius: 999px; padding: 0 9px; font-size: 13px; line-height: 1.7; }
.active-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; }
.results-bar { display: grid; gap: var(--s2); margin-bottom: var(--s3); }
.count { color: var(--mute); font-size: 15px; min-height: 1.5em; margin: 0; font-weight: 700; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin-top: var(--s4); }
.pager__info { color: var(--mute); font-size: 15px; }

.chips { display: flex; gap: var(--s1); flex-wrap: wrap; margin: var(--s2) 0; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--field-border); color: var(--ink); text-decoration: none; font-size: 15px;
}
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip--x { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
.chip--x:hover { background: var(--surface-3); color: var(--brand-ink); }
.chip--on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip--on:hover { color: var(--on-brand); background: var(--brand-hover); }

/* ── الحقول ──────────────────────────────────────────────────────── */
input, select, textarea { font: inherit; color: var(--ink); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field__label { font-weight: 700; font-size: 16px; }
.filters input[type="search"], .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  background: var(--surface); border: var(--bw) solid var(--field-border); border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 104px; line-height: 1.7; }
.field input:hover, .field select:hover, .field textarea:hover, .filters input[type="search"]:hover { border-color: var(--ink); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .filters input:focus-visible { border-color: var(--focus); }
.field input:disabled, .field select:disabled, .field textarea:disabled { opacity: .6; cursor: not-allowed; background: var(--surface-2); }
.field [aria-invalid="true"] { border-color: var(--err-line) !important; box-shadow: 0 0 0 1px var(--err-line); background: var(--err-bg) !important; }
.field__err { color: var(--err-ink); font-weight: 700; font-size: 15px; margin: 0; }
.field__err::before { content: "⚠ "; }
.hint { color: var(--mute); font-size: 14px; font-weight: 400; margin: 0; }
.opt, .req { color: var(--mute); font-weight: 400; font-size: 14px; }
.counter { color: var(--mute); font-size: 13px; margin: 0; text-align: end; }
.counter--over { color: var(--err-ink); font-weight: 700; }

/* ── النماذج ─────────────────────────────────────────────────────── */
.form {
  display: grid; gap: var(--s4); max-width: 760px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3); box-shadow: var(--shadow);
}
@media (min-width: 600px) { .form { padding: var(--s5); } }
.form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.step { display: grid; gap: var(--s3); }
.step + .step { border-top: 1px dashed var(--line); padding-top: var(--s4); }
.form.is-stepper .step + .step { border-top: 0; padding-top: 0; }
.form.is-stepper .step:not([hidden]) { animation: step-in .22s ease both; }
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } }
.step__legend { display: flex; align-items: center; gap: var(--s2); padding: 0; margin-bottom: var(--s1); float: inline-start; width: 100%; }
.step__legend + * { clear: both; }
.step__num {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 700;
}
.step__title { margin: 0; font-size: 22px; }
.step__title:focus { outline: none; }
.step__title:focus-visible { outline: 3px solid var(--focus); }
.step__nav { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--line); }
.step__nav--final { justify-content: flex-end; }
.step__nav--final [data-prev]:not([hidden]) { margin-inline-end: auto; }
.grid-2 { display: grid; gap: var(--s3); }
@media (min-width: 600px) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; } }

.choice, .checks { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: var(--s1); }
.choice legend, .checks legend { font-weight: 700; font-size: 16px; padding: 0; margin-bottom: 6px; }
.choice__opts { display: flex; flex-wrap: wrap; gap: var(--s1); }
.choice__opt {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 18px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--field-border); border-radius: 999px;
}
.choice__opt input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.choice__opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.choice__opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.check { display: flex; align-items: flex-start; gap: 12px; min-height: var(--tap); padding: 10px 0; cursor: pointer; line-height: 1.6; }
.check input { flex: 0 0 22px; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--brand); }
.consent { background: var(--surface-2); border-radius: var(--radius-sm); padding: var(--s2) var(--s3); }
.consent legend { float: inline-start; width: 100%; padding-top: var(--s2); }
.consent legend + * { clear: both; }

/* مؤشر الخطوات */
.stepper { max-width: 760px; margin: 0 auto var(--s3); }
.stepper__label { font-weight: 700; color: var(--brand-ink); margin-bottom: var(--s2); text-align: center; }
.stepper__bar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.stepper__bar li { position: relative; display: grid; gap: 6px; justify-items: center; text-align: center; font-size: 13px; line-height: 1.4; color: var(--mute); padding: 0 4px; }
.stepper__bar li::before { content: ""; position: absolute; top: 17px; inset-inline-start: -50%; width: 100%; height: 3px; background: var(--line); }
.stepper__bar li:first-child::before { display: none; }
.stepper__bar li.is-done::before, .stepper__bar li.is-current::before { background: var(--brand); }
.stepper__dot {
  position: relative; z-index: 1; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--field-border); color: var(--mute); font-weight: 700; font-size: 16px;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.stepper__bar li.is-done .stepper__dot { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.stepper__bar li.is-current .stepper__dot { border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 5px var(--brand-soft); }
.stepper__bar li.is-current { color: var(--ink); font-weight: 700; }
@media (min-width: 600px) { .stepper__bar li { font-size: 15px; } }

/* رفع الصور */
.upload { position: relative; }
.upload__input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.upload__box {
  display: grid; justify-items: center; gap: 4px; padding: var(--s4) var(--s3); text-align: center; cursor: pointer;
  background: var(--surface-2); border: 2px dashed var(--field-border); border-radius: var(--radius-sm);
  transition: border-color .15s ease, background .15s ease;
}
.upload__box:hover { border-color: var(--brand); background: var(--surface-3); }
.upload__input:focus-visible + .upload__box { outline: 3px solid var(--focus); outline-offset: 2px; }
.upload__icon { font-size: 28px; line-height: 1; }
.upload__title { font-weight: 700; color: var(--brand-ink); }
.upload__status { margin: 0; font-size: 15px; color: var(--mute); }
.upload__status:empty { display: none; }
.thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1); }
.thumbs:empty { display: none; }
.thumbs li { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .thumbs__cover { position: absolute; inset-block-end: 4px; inset-inline-start: 4px; font-size: 12px; padding: 0 8px; }
.thumbs .thumbs__cover::before { display: none; }

.review { background: var(--surface-2); border-radius: var(--radius-sm); padding: var(--s3); }
.review h3 { margin-bottom: var(--s2); }

/* ── صفحة القطة ─────────────────────────────────────────────────── */
.listing { display: grid; gap: var(--s3); }
@media (min-width: 900px) {
  .listing { grid-template-columns: 1.15fr 1fr; gap: var(--s4); align-items: start; }
  .gallery { position: sticky; top: 88px; }
}
.gallery { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gallery__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; background: var(--surface-2); }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; aspect-ratio: 4 / 3; }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { list-style: none; margin: 0; padding: var(--s2); display: flex; gap: var(--s1); overflow-x: auto; }
.gallery__thumbs a { display: block; width: 68px; height: 51px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; opacity: .7; transition: opacity .15s ease, border-color .15s ease; }
.gallery__thumbs a:hover { opacity: 1; }
.gallery__thumbs a[aria-current="true"] { border-color: var(--brand); opacity: 1; }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 600px) { .gallery__thumbs a { width: 88px; height: 66px; } }
.gallery--empty { aspect-ratio: 4 / 3; }
.listing__body { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); box-shadow: var(--shadow); }
@media (min-width: 600px) { .listing__body { padding: var(--s4); } }
.listing__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: 2px; }
.listing__head h1 { margin: 0; }
.listing__where { color: var(--mute); margin-bottom: var(--s3); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); margin: 0 0 var(--s3); }
.facts > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 14px; min-width: 0; }
.facts > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.facts dt { color: var(--mute); font-size: 13px; line-height: 1.5; }
.facts dd { margin: 0; font-weight: 700; line-height: 1.5; }
.review .facts > div { background: var(--surface); }
.block { margin-bottom: var(--s3); }
.block h2, .contact h2 { font-size: 19px; margin-bottom: 6px; }
.prose-text { white-space: pre-wrap; margin: 0; }
.contact { background: var(--surface-2); border-radius: var(--radius-sm); padding: var(--s3); margin: var(--s3) 0; }
.status-box { background: var(--done-bg); color: var(--done-ink); border-radius: var(--radius-sm); padding: var(--s2) var(--s3); font-weight: 700; margin: 0 0 var(--s2); }
.block--tips { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s3); }
.tips { margin: 0 0 var(--s1); padding-inline-start: 22px; }
.report { margin-top: var(--s3); border-top: 1px solid var(--line); padding-top: var(--s2); }
.report summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 700; color: var(--mute); }
.report summary:hover { color: var(--ink); }
.report__form { display: grid; gap: var(--s2); margin-top: var(--s2); }

/* شريط واتساب اللاصق على الجوال */
.wa-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  padding: var(--s2) var(--s3) calc(var(--s2) + env(safe-area-inset-bottom, 0px));
  background: var(--header-bg); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
body:has(.wa-bar) .foot { padding-bottom: 96px; }
@media (max-width: 899px) { .contact__btn { display: none; } .contact #wa-note { margin-top: 0; } }
@media (min-width: 900px) { .wa-bar { display: none; } body:has(.wa-bar) .foot { padding-bottom: var(--s4); } }

/* ── الدخول ──────────────────────────────────────────────────────── */
.auth {
  max-width: 560px; margin: var(--s5) auto; padding: var(--s5) var(--s3);
  display: grid; justify-items: center; gap: var(--s2); text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.auth .alert { width: 100%; margin: 0; text-align: start; }
.auth__emoji { width: 64px; height: 64px; border-radius: 50%; }
.auth h1 { margin: 0; }
.auth__lead { color: var(--mute); margin: 0; max-width: 44ch; }
.auth__points { text-align: start; color: var(--mute); font-size: 15px; margin: var(--s2) 0 0; padding-inline-start: 22px; }

/* ── لوحة المعلن ────────────────────────────────────────────────── */
.dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s3); }
.dash-head h1 { margin: 0; }
.reminder {
  background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-ink); border-inline-start-width: 6px;
  border-radius: var(--radius); padding: var(--s3) var(--s4); margin-bottom: var(--s3);
}
.reminder h2 { font-size: 20px; }
.dash-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
@media (min-width: 900px) { .dash-list { grid-template-columns: 1fr 1fr; align-items: start; } }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.dash-card__top { display: grid; grid-template-columns: 72px 1fr; gap: var(--s3); align-items: center; padding: var(--s3); }
.dash-card__media { aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.dash-card__media img { width: 100%; height: 100%; object-fit: cover; }
.dash-card__media .ph { background-size: 80% auto; }
.dash-card__body { min-width: 0; }
.dash-card__head { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: center; }
.dash-card__name { font-weight: 700; font-size: 20px; color: var(--ink); }
.dash-card__meta { color: var(--mute); font-size: 14px; margin: 2px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s1); align-items: flex-start; padding: var(--s2) var(--s3); border-top: 1px solid var(--line); }
.actions--more { background: var(--surface-2); }
.mod-note { background: var(--err-bg); color: var(--err-ink); padding: var(--s2) var(--s3); font-size: 15px; }
.mod-note p:last-child { margin: 0; }
.mod-note a { color: var(--err-ink); }
.danger-zone { display: inline-block; margin-inline-start: auto; }
.danger-zone summary { list-style: none; }
.danger-zone summary::-webkit-details-marker { display: none; }
.danger-zone[open] { display: block; width: 100%; }
.danger-zone__body { margin-top: var(--s2); background: var(--err-bg); color: var(--err-ink); border-radius: var(--radius-sm); padding: var(--s2) var(--s3); }

/* ── الإشراف ─────────────────────────────────────────────────────── */
.tabs { display: flex; flex-wrap: wrap; gap: var(--s1); margin-bottom: var(--s3); }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--field-border); color: var(--ink); font-weight: 700; text-decoration: none;
}
.tabs a:hover { background: var(--surface-2); color: var(--ink); }
.tabs__n { background: var(--brand-soft); color: var(--brand-ink); border-radius: 999px; padding: 0 8px; font-size: 14px; }
.mod-sec { margin-bottom: var(--s5); }
.mod-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.mod-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s3); min-width: 0; }
.mod-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2); align-items: center; }
.mod-card__title { font-weight: 700; font-size: 18px; margin: 0; }
.mod-card__meta, .mod-card__count { color: var(--mute); font-size: 14px; }
.mod-card__note { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; }
.mod-card__listing { display: flex; flex-wrap: wrap; gap: 6px var(--s2); align-items: center; }
.mod-card__actions { display: grid; gap: var(--s3); margin-top: var(--s2); padding-top: var(--s2); border-top: 1px dashed var(--line); }
@media (min-width: 800px) { .mod-card__actions { grid-template-columns: 1fr 1fr; } }
.mini-form { display: grid; gap: var(--s2); align-content: start; }
.mini-form .btn { justify-self: start; }
.audit { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.audit__row { display: grid; gap: 2px; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); font-size: 15px; }
.audit__row:last-child { border-bottom: 0; }
.audit__time, .audit__who { color: var(--mute); font-size: 14px; }
.audit__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.kv__k { color: var(--mute); }
@media (min-width: 800px) { .audit__row { grid-template-columns: 200px 1fr 170px; align-items: baseline; } .audit__meta { grid-column: 2 / -1; } }

/* ── الصفحات الثابتة ────────────────────────────────────────────── */
.prose { max-width: 760px; margin: 0 auto; }
.prose section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s3) var(--s4); margin-bottom: var(--s2); }
.prose h2 { font-size: 20px; }
.prose ul { margin: 0; padding-inline-start: 22px; }
.prose li { margin-bottom: 6px; }
.prose p:last-child { margin-bottom: 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary { display: flex; align-items: center; min-height: 48px; cursor: pointer; font-weight: 700; padding: 6px 0; }
.faq details p { color: var(--mute); }
.faq summary { justify-content: space-between; gap: var(--s2); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--brand-ink); font-size: 20px; line-height: 1; }
.faq details[open] > summary::after { content: "−"; }
.faq summary:focus-visible { outline: 3px solid var(--focus, var(--brand-ink)); outline-offset: 3px; border-radius: 8px; }
.home-faq { margin: var(--s5) 0 var(--s4); }
.home-faq .faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s1) var(--s4); }

/* ── دليل المتاجر (معطّل افتراضيًا: STORES_ENABLED=1) ──────────── */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); margin-bottom: var(--s3); }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--s3) var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-weight: 700; }
.store-list { display: grid; gap: var(--s2); }
.store-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  min-height: 64px; padding: var(--s2) var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink);
}
.store-row:hover { border-color: var(--brand); color: var(--ink); }
.store-row__body { display: flex; flex-direction: column; min-width: 0; }
.store-row__body small { color: var(--mute); font-size: 14px; }
.store-row__side { display: flex; align-items: center; gap: var(--s2); flex-shrink: 0; }
.store-row__rate { color: var(--brand-ink); font-size: 15px; }
.store-row__go { color: var(--mute); }

/* ── شريط المعاينة (للتطوير فقط) ────────────────────────────────── */
.preview-bar {
  display: flex; flex-wrap: wrap; gap: 4px var(--s3); align-items: center; justify-content: center;
  background: #0E0E10; color: #FFFFFF; padding: 6px var(--s3); font-size: 14px;
}
.preview-bar a { color: #FFE08A; display: inline-flex; align-items: center; min-height: 36px; }
.preview-bar__themes { display: inline-flex; flex-wrap: wrap; gap: var(--s2); }
.preview-list { columns: 2 260px; padding-inline-start: 22px; }
.preview-list li { margin-bottom: 6px; break-inside: avoid; }


/* ── مساحات لمس ≥ 44px للروابط داخل النصوص (الحشو العمودي لا يغيّر ارتفاع السطر) ── */
.fine a, .note a, .mod-note a, .prose p a, .prose li a, .tips + p a, .report__form a, .alert a, .foot p a {
  padding: 13px 4px; margin: -13px -4px;
}
.dash-card__name { display: inline-flex; align-items: center; min-height: 44px; }
.mod-card__listing a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 4px; }
.check, .toggle, .choice__opt { min-height: 48px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .cat-card:hover, .cat-card:hover .cat-card__media img { transform: none; }
}

/* وضع التطوير المحلي: نموذج الدخول التجريبي (لا يظهر في الإنتاج) */
.auth__dev { display: grid; gap: var(--s2); width: 100%; padding: var(--s3); border: 1px dashed var(--line, currentColor); border-radius: 12px; }
.auth__dev .fine { margin: 0; text-align: center; }

/* حذف الحساب */
.stack { display: grid; gap: var(--s3); }
.acct-link { margin-top: var(--s5, 32px); text-align: center; }
