@font-face {
  font-family: "Zaatar";
  src: url("fonts/Boharat-Zataar-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --primary: #963A25;
  --dark: #4a1d12;
  --bg: #F4F0EA;
  --text: #303030;
  --primary-soft: rgba(150, 58, 37, .1);
  --radius: 18px;
  --shadow: 0 6px 22px rgba(60, 30, 20, .09);
  --shadow-hover: 0 14px 34px rgba(60, 30, 20, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  font-family: "Cairo", "Tajawal", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.icon { width: 1.15em; height: 1.15em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* خط الشعار */
.logo-font { font-family: "Zaatar", "Cairo", sans-serif; font-weight: 700; }

/* ---------- الهيدر ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(244, 240, 234, .92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(0, 0, 0, .06); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-size: 2rem; color: var(--primary); line-height: 1; padding-top: 4px; }
.nav { display: flex; gap: 6px; }
.nav a { padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .95rem; transition: background .2s, color .2s; }
.nav a:hover { background: var(--primary-soft); color: var(--primary); }

/* ---------- القسم العلوي ---------- */
.hero {
  background: radial-gradient(circle at 15% 20%, #6b2a1a 0, transparent 45%), var(--dark);
  color: #fff;
  padding: 56px 0 120px;
  clip-path: polygon(0 0, 100% 0, 100% 86%, 0 100%);
  position: relative;
  overflow: hidden;
}
.hero .container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.3; margin-bottom: 12px; }
.hero p { color: rgba(255, 255, 255, .85); max-width: 560px; margin-bottom: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); font-size: .85rem; font-weight: 600; }
.hero-logo { text-align: center; }
.hero-logo .big {
  font-size: clamp(5rem, 16vw, 10rem);
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 6px 0 var(--primary), 0 14px 40px rgba(0, 0, 0, .35);
  display: inline-block;
  padding: 10px 20px;
}
.hero-logo small { display: block; margin-top: 6px; letter-spacing: .05em; opacity: .75; font-size: .95rem; }

/* ---------- الأزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 28px; border-radius: 999px; font-weight: 700; font-size: 1rem; transition: transform .2s, box-shadow .2s, background .2s; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0, 0, 0, .25); }
.hero .btn-primary { background: #fff; color: var(--primary); }
.btn-ghost { border: 1.5px solid rgba(255, 255, 255, .5); color: #fff; background: rgba(255, 255, 255, .08); }
.btn-ghost:hover { background: rgba(255, 255, 255, .18); }
.btn-outline { border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ---------- عناوين الأقسام ---------- */
.section { padding: 56px 0; }
.section-head { text-align: center; margin-bottom: 28px; }
.pill { display: inline-block; background: var(--primary); color: #fff; font-weight: 700; font-size: 1.15rem; padding: 6px 28px; border-radius: 999px; box-shadow: 0 4px 12px rgba(150, 58, 37, .3); }
.section-head p { color: #7a6f68; margin-top: 10px; }
.underlined { text-align: center; margin-bottom: 28px; }
.underlined h2 { font-size: 1.5rem; color: var(--dark); }
.underlined span { display: block; color: #7a6f68; font-size: .9rem; }
.underlined::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 4px; background: var(--primary); margin: 10px auto 0; }

/* ---------- فلترة ---------- */
.filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter { padding: 7px 22px; border-radius: 999px; background: #fff; border: 1.5px solid rgba(150, 58, 37, .25); font-weight: 600; transition: all .2s; }
.filter:hover { border-color: var(--primary); }
.filter.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- بطاقات الأعمال ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .3s ease, box-shadow .3s ease; }
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }
.card .cover { aspect-ratio: 1 / 1; overflow: hidden; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .cover img, .card:hover .poster { transform: scale(1.04); }
.ribbon { background: var(--primary); color: #fff; text-align: center; font-weight: 700; padding: 6px 10px; direction: ltr; unicode-bidi: plaintext; }
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body p { font-size: .9rem; color: #5b524c; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .75rem; padding: 2px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.empty { text-align: center; color: #7a6f68; padding: 30px 0; }

/* غلاف بوستر تلقائي */
.poster { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; color: #fff; text-align: center; transition: transform .4s; position: relative; overflow: hidden; }
.poster::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 15%, rgba(255, 255, 255, .22), transparent 40%), repeating-linear-gradient(45deg, rgba(255, 255, 255, .05) 0 10px, transparent 10px 20px); }
.poster .icon { width: 52px; height: 52px; position: relative; opacity: .9; }
.poster b { position: relative; font-size: 1.7rem; line-height: 1.2; direction: ltr; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); word-break: break-word; }

/* ---------- الرؤية والرسالة ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.about .box { background: #fff; border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); border-top: 5px solid var(--primary); }
.about h3, .about h2 { color: var(--primary); margin-bottom: 8px; font-size: 1.2rem; }

/* ---------- لماذا شمل ---------- */
.why { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature { background: #fff; border-radius: var(--radius); padding: 24px 18px; text-align: center; box-shadow: var(--shadow); transition: transform .3s; }
.feature:hover { transform: translateY(-5px); }
.feature .ico { width: 54px; height: 54px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 12px; font-size: 1.5rem; }
.feature h3 { font-size: 1.05rem; margin-bottom: 4px; }
.feature p { font-size: .88rem; color: #5b524c; }

/* ---------- الأسئلة الشائعة ---------- */
.faq { max-width: 720px; margin-inline: auto; display: grid; gap: 12px; }
.faq details { background: #fff; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23963A25' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/16px no-repeat; transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq .answer { padding: 0 20px 18px; color: #5b524c; }

/* ---------- الفوتر ---------- */
.footer { background: var(--dark); color: #fff; padding: 44px 0 20px; margin-top: 30px; }
.footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.footer .brand { color: #fff; font-size: 2.4rem; display: inline-block; }
.footer p { color: rgba(255, 255, 255, .75); font-size: .92rem; }
.footer h4 { margin-bottom: 10px; }
.footer ul { list-style: none; display: grid; gap: 6px; }
.footer li a { display: inline-flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .8); }
.footer li a:hover { color: #fff; }
.copy { text-align: center; margin-top: 30px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .82rem; color: rgba(255, 255, 255, .6); }

/* ---------- صفحة العمل ---------- */
.p-hero { padding: 48px 0 110px; }
.p-hero .container { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: center; }
.p-cover { border-radius: 24px; overflow: hidden; aspect-ratio: 1 / 1; box-shadow: 0 18px 40px rgba(0, 0, 0, .4); }
.p-cover img { width: 100%; height: 100%; object-fit: cover; }
.p-info h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.2; direction: ltr; unicode-bidi: plaintext; text-align: right; }
.p-sub { color: #f2b49f; font-weight: 700; font-size: 1.2rem; margin: 4px 0 10px; }
.p-info .chips { margin-bottom: 20px; }
.p-actions { display: grid; gap: 12px; max-width: 420px; }
.p-actions .btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); outline: 2px solid rgba(255, 255, 255, .15); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: #fff; border-radius: var(--radius); padding: 26px 18px; text-align: center; box-shadow: var(--shadow); }
.step .circle { width: 58px; height: 58px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; position: relative; font-size: 1.4rem; }
.step .num { position: absolute; top: -4px; right: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--dark); font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.step h3 { font-size: 1.05rem; }
.step p { font-size: .9rem; color: #5b524c; }

.shots { display: flex; gap: 16px; overflow-x: auto; padding: 6px 4px 16px; scroll-snap-type: x mandatory; }
.shots button { flex: 0 0 min(320px, 80%); scroll-snap-align: start; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); background: #fff; transition: transform .25s; }
.shots button:hover { transform: translateY(-4px); }
.shots img { width: 100%; height: 100%; object-fit: cover; }

.back-row { text-align: center; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .85); display: none; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.notfound { text-align: center; padding: 100px 0; }
.notfound h1 { color: var(--primary); margin-bottom: 10px; }

/* ---------- تجاوب ---------- */
@media (max-width: 860px) {
  .hero .container, .p-hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero p, .p-actions { margin-inline: auto; }
  .chips { justify-content: center; }
  .hero-logo { order: -1; }
  .p-cover { max-width: 240px; margin-inline: auto; }
  .p-info h1 { text-align: center; }
  .why { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .about, .footer .cols { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .nav a { padding: 6px 9px; font-size: .85rem; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .card-body { padding: 10px 10px 14px; }
  .card-body p { font-size: .8rem; }
  .poster b { font-size: 1.15rem; }
  .why { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- المجتمع: تقييمات، بلاغات، منتدى ---------- */
.stars { color: #d99a00; letter-spacing: 1px; }
.rate { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.rate small { color: #7a6f68; }
.narrow { max-width: 760px; margin-inline: auto; }
.cform { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: grid; gap: 14px; }
.cform h3 { color: var(--primary); font-size: 1.1rem; }
.cform label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 4px; }
.cform small { color: #7a6f68; }
.cform input, .cform select, .cform textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1.5px solid #dcd3ca; border-radius: 12px; background: #fff; color: var(--text); }
.cform textarea { min-height: 96px; resize: vertical; }
.cform input:focus, .cform select:focus, .cform textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
.c-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.stars-pick { display: flex; gap: 4px; }
.stars-pick button { font-size: 2.1rem; line-height: 1; color: #cfc4ba; transition: transform .15s, color .15s; }
.stars-pick button.on { color: #d99a00; }
.stars-pick button:hover { transform: scale(1.15); }
.cmsg { padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.cmsg.ok { background: #e6f4ea; color: #1e6b34; }
.cmsg.err { background: #fde8e6; color: #b3261e; }
.cmsg[hidden] { display: none; }
.rv-sum { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; color: #5b524c; }
.rv-sum .big { font-size: 2.6rem; font-weight: 800; color: var(--dark); line-height: 1; }
.rv-sum .stars { font-size: 1.5rem; }
.rv-list { display: grid; gap: 12px; margin-top: 20px; }
.review, .post-card, .post-full { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; }
.rv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rv-head small { color: #7a6f68; margin-inline-start: auto; }
.review p, .post-full p { margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.post-card { display: block; transition: transform .25s, box-shadow .25s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.post-card h3 { font-size: 1.05rem; margin: 6px 0 2px; }
.post-card p { color: #5b524c; font-size: .9rem; overflow-wrap: anywhere; }
.post-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .82rem; color: #7a6f68; }
.post-full h2 { margin: 8px 0; color: var(--dark); overflow-wrap: anywhere; }
.stack { display: grid; gap: 14px; }
.hero.small { padding: 40px 0 96px; }
.hero.small .container { grid-template-columns: 1fr; text-align: center; }
.hero.small p { margin-inline: auto; margin-bottom: 0; }
@media (max-width: 560px) { .c-row { grid-template-columns: 1fr; } }

/* ---------- المجتمع: تقييمات، إبلاغ، منتدى ---------- */
.stars { color: #e8a317; letter-spacing: 2px; white-space: nowrap; }
.stars i { font-style: normal; color: #d9cfc4; }
.p-rating { margin-bottom: 10px; font-size: 1rem; }
.p-rating .stars { color: #ffc94d; }
.p-rating .stars i { color: rgba(255, 255, 255, .3); }
.p-rating span { opacity: .75; font-size: .9rem; }

.rev-sum { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; color: #5b524c; }
.rev-sum .avg { font-size: 2rem; color: var(--dark); line-height: 1; }
.rev-sum .stars { font-size: 1.3rem; }
.rev-list, .posts { display: grid; gap: 12px; max-width: 760px; margin: 0 auto 28px; }
.rev, .post { background: #fff; border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.rev-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.rev-h small, .post small { color: #8a7f77; margin-inline-start: auto; }
.rev p, .post p { white-space: pre-wrap; overflow-wrap: anywhere; color: #4a423d; }
.post-h { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.post small { display: block; margin-top: 8px; }

.cform { max-width: 760px; margin: 0 auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: grid; gap: 14px; position: relative; }
.cform h3 { color: var(--primary); }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cf-field { display: grid; gap: 4px; }
.cf-field label { font-weight: 700; font-size: .9rem; }
.cf-field small { font-weight: 400; color: #8a7f77; }
.cform input, .cform select, .cform textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1.5px solid #dcd3ca; border-radius: 12px; background: #fff; color: var(--text); }
.cform input:focus, .cform select:focus, .cform textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
.cform textarea { min-height: 100px; resize: vertical; }
.cform .btn { justify-self: start; }
.cform .btn:disabled { opacity: .6; cursor: wait; }
.hp { position: absolute !important; top: 0; right: 0; width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
.star-input { display: flex; gap: 4px; direction: ltr; justify-content: flex-end; }
.star-input button { font-size: 2rem; line-height: 1; color: #d9cfc4; transition: color .15s, transform .15s; }
.star-input button.on, .star-input button:hover { color: #e8a317; }
.star-input button:hover { transform: scale(1.15); }
.cf-status { font-weight: 600; min-height: 1.4em; }
.cf-status.ok { color: #1e6b34; }
.cf-status.err { color: #b3261e; }

.report { max-width: 760px; margin: 0 auto; }
.report summary { cursor: pointer; text-align: center; color: var(--primary); font-weight: 700; padding: 10px; list-style: none; }
.report summary::-webkit-details-marker { display: none; }
.report summary:hover { text-decoration: underline; }
.report[open] summary { margin-bottom: 12px; }

@media (max-width: 560px) { .cf-row { grid-template-columns: 1fr; } .site-header .nav a { padding: 6px 7px; } }

/* ==========================================================
   شخصية شمل (وجه الشعار) — الحالات: idle / think / oooh / upset
   كل حركة 3 ثواني، بدون حواجب ولا بؤبؤ
   ========================================================== */
.mascot { display: block; overflow: visible; }
.mascot .m-body { fill: var(--primary); }
.mascot .m-look { transform: translate(var(--lx, 0px), var(--ly, 0px)); transition: transform .3s ease-out; }
.mascot .m-eye { transform-box: fill-box; transform-origin: center; animation: sb-blink 4.5s infinite; transition: transform .4s; }
.mascot .m-mouth { display: none; fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; }
.mascot .m-o { fill: #fff; stroke: none; }
.mascot .m-smile { display: inline; }
.mascot .m-dots circle { fill: #fff; opacity: 0; }

/* يفكّر: ينظر لفوق، فمه مستقيم، نقاط تنبض، وميل خفيف */
.mascot[data-mood="think"] { animation: sb-tilt 3s ease-in-out infinite; }
.mascot[data-mood="think"] .m-eye { animation: sb-think-eyes 3s ease-in-out infinite; }
.mascot[data-mood="think"] .m-smile { display: none; }
.mascot[data-mood="think"] .m-flat { display: inline; }
.mascot[data-mood="think"] .m-dots circle { animation: sb-dot 3s infinite; }
.mascot[data-mood="think"] .m-dots circle:nth-child(2) { animation-delay: .25s; }
.mascot[data-mood="think"] .m-dots circle:nth-child(3) { animation-delay: .5s; }

/* أوووو: عيون واسعة وفم دائري */
.mascot[data-mood="oooh"] { animation: sb-pop 3s ease-in-out; }
.mascot[data-mood="oooh"] .m-smile { display: none; }
.mascot[data-mood="oooh"] .m-o { display: inline; }
.mascot[data-mood="oooh"] .m-eye { animation: none; transform: scale(1.2); }

/* استياء: فم مقلوب، والعينين تُغمضان ببطء ثم تنفتحان، ورأس ينزل شوي */
.mascot[data-mood="upset"] { animation: sb-sulk 3s ease-in-out; }
.mascot[data-mood="upset"] .m-smile { display: none; }
.mascot[data-mood="upset"] .m-frown { display: inline; }
.mascot[data-mood="upset"] .m-eye { animation: sb-sulk-eye 3s ease-in-out; }
.mascot[data-mood="upset"] .m-look { transform: translate(0, 1.5px); }

@keyframes sb-blink { 0%, 88%, 100% { transform: scaleY(1); } 92% { transform: scaleY(.08); } 95% { transform: scaleY(1); } }
@keyframes sb-think-eyes { 0%, 100% { transform: scaleY(1); } 35%, 60% { transform: scaleY(.08); } }
@keyframes sb-dot { 0%, 100% { opacity: .2; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
@keyframes sb-tilt { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes sb-pop { 0%, 100% { transform: scale(1); } 25%, 70% { transform: scale(1.1); } }
@keyframes sb-sulk { 0%, 100% { transform: translateY(0); } 30%, 75% { transform: translateY(2px); } }
@keyframes sb-sulk-eye { 0%, 100% { transform: scaleY(.85); } 25%, 70% { transform: scaleY(.08); } 90% { transform: scaleY(.85); } }

/* ==========================================================
   شمل بوت: زر جانبي ثابت + نافذة المحادثة
   ========================================================== */
.sb-fab { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; background: #fff; border-radius: 999px; box-shadow: 0 6px 24px rgba(60, 30, 20, .25); border: 1px solid rgba(0, 0, 0, .06); transition: transform .2s, box-shadow .2s; }
.sb-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(60, 30, 20, .32); }
.sb-fab:focus-visible, .sb-opt:focus-visible, .sb-x:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.sb-fab .mascot { width: 46px; height: 46px; }
.sb-fab-label { font-weight: 800; font-size: .85rem; color: var(--primary); }
.sb-fab[hidden], .sb-panel[hidden] { display: none; }

.sb-panel { position: fixed; right: 16px; bottom: 16px; z-index: 95; width: min(390px, calc(100vw - 24px)); height: min(620px, calc(100dvh - 32px)); display: flex; flex-direction: column; background: var(--bg); border-radius: 22px; box-shadow: 0 18px 60px rgba(40, 15, 8, .38); overflow: hidden; animation: sb-in .25s ease-out; }
@keyframes sb-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.sb-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--dark); color: #fff; }
.sb-head .mascot { width: 48px; height: 48px; flex: none; }
.sb-head .mascot .m-body { fill: var(--primary); }
.sb-title { flex: 1; line-height: 1.3; }
.sb-title b { display: block; font-size: 1.05rem; }
.sb-title small { opacity: .75; font-size: .8rem; }
.sb-x { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .12); font-size: 1.1rem; line-height: 1; transition: background .2s; }
.sb-x:hover { background: rgba(255, 255, 255, .25); }

.sb-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.sb-msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; line-height: 1.7; font-size: .95rem; animation: sb-msg .25s ease-out; overflow-wrap: anywhere; }
@keyframes sb-msg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sb-msg.bot { align-self: flex-start; background: #fff; box-shadow: 0 2px 8px rgba(60, 30, 20, .08); border-top-right-radius: 4px; }
.sb-msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-top-left-radius: 4px; }
.sb-msg.wide { max-width: 100%; width: 100%; }
.sb-typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.sb-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); opacity: .35; animation: sb-dot 1s infinite; }
.sb-typing i:nth-child(2) { animation-delay: .15s; }
.sb-typing i:nth-child(3) { animation-delay: .3s; }

.sb-opts { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 14px; max-height: 42%; overflow-y: auto; border-top: 1px solid rgba(0, 0, 0, .06); background: rgba(255, 255, 255, .5); }
.sb-opts:empty { display: none; }
.sb-opt { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--primary); background: #fff; color: var(--primary); font-weight: 700; font-size: .9rem; transition: background .15s, color .15s, transform .15s; }
.sb-opt:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.sb-opt.soft { border-color: #cdbfb4; color: #6b5f57; }
.sb-opt.soft:hover { background: #6b5f57; border-color: #6b5f57; color: #fff; }

.sb-card { display: block; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--primary-soft); border: 1px solid rgba(150, 58, 37, .18); transition: transform .15s; }
.sb-card:hover { transform: translateY(-2px); }
.sb-card b { display: block; color: var(--primary); }
.sb-card span { display: block; font-size: .85rem; color: #5b524c; }
.sb-card em { display: block; margin-top: 4px; font-style: normal; font-size: .8rem; color: #8a7f77; }
.sb-link { display: inline-block; margin-top: 6px; font-weight: 700; color: var(--primary); text-decoration: underline; }

.sb-form { display: grid; gap: 10px; }
.sb-form label { display: block; font-weight: 700; font-size: .82rem; margin-bottom: 2px; }
.sb-form small { font-weight: 400; color: #8a7f77; }
.sb-form input, .sb-form textarea { font: inherit; font-size: .92rem; width: 100%; padding: 8px 10px; border: 1.5px solid #dcd3ca; border-radius: 10px; background: #fff; color: var(--text); }
.sb-form input:focus, .sb-form textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
.sb-form textarea { min-height: 84px; resize: vertical; }
.sb-form .btn { justify-self: start; padding: 8px 22px; font-size: .92rem; }
.sb-form .btn:disabled { opacity: .6; cursor: wait; }
.sb-status { font-weight: 600; font-size: .85rem; min-height: 1.2em; }
.sb-status.err { color: #b3261e; }
.sb-status.ok { color: #1e6b34; }

@media (max-width: 560px) {
  .sb-fab-label { display: none; }
  .sb-fab { right: 12px; bottom: 12px; padding: 6px; }
  .sb-fab .mascot { width: 42px; height: 42px; }
  .sb-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: min(640px, calc(100dvh - 16px)); }
}

/* ==========================================================
   صفحة 404
   ========================================================== */
.nf { background: radial-gradient(circle at 15% 20%, #6b2a1a 0, transparent 45%), var(--dark); color: #fff; text-align: center; padding: 56px 0 130px; clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%); }
.nf-code { display: flex; align-items: center; justify-content: center; gap: clamp(6px, 2vw, 18px); direction: ltr; font-weight: 800; font-size: clamp(5rem, 20vw, 9.5rem); line-height: 1; letter-spacing: -.02em; }
.nf-code .mascot { width: clamp(4.4rem, 17vw, 8.4rem); height: clamp(4.4rem, 17vw, 8.4rem); box-shadow: 0 10px 0 rgba(0, 0, 0, .22); border-radius: 26%; }
.nf-code .mascot[data-mood] { animation: nf-wiggle 3.4s ease-in-out infinite; }
.nf-code .mascot .m-eye { animation-iteration-count: infinite; }
@keyframes nf-wiggle { 0%, 12%, 100% { transform: rotate(0); } 3% { transform: rotate(-7deg); } 6% { transform: rotate(7deg); } 9% { transform: rotate(-4deg); } }
.nf h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); margin: 22px 0 8px; }
.nf p { max-width: 520px; margin: 0 auto 26px; opacity: .85; }
.nf .row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.nf .btn-primary { background: #fff; color: var(--primary); }
.nf-more { margin-top: -70px; position: relative; padding-bottom: 60px; }

@media (prefers-reduced-motion: reduce) {
  .mascot, .mascot *, .sb-panel, .sb-msg, .sb-typing i { animation: none !important; }
}

/* ==========================================================
   هياكل التحميل: مربع شفاف + لمعة مائلة تنزل من الأعلى للأسفل
   ========================================================== */
.skel { position: relative; overflow: hidden; background: rgba(150, 58, 37, .08); }
.skel > img { opacity: 0; }
.skel::after { content: ""; position: absolute; left: -15%; width: 130%; top: 0; height: 45%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .85) 50%, transparent);
  transform: translateY(-130%) rotate(-7deg); animation: skel-sweep 1.5s ease-in-out infinite; }
@keyframes skel-sweep { 0% { transform: translateY(-130%) rotate(-7deg); } 100% { transform: translateY(330%) rotate(-7deg); } }
.card .cover.skel { aspect-ratio: 1 / 1; }
.p-cover.skel { aspect-ratio: 1 / 1; border-radius: 24px; }
.shots button.skel { aspect-ratio: 16 / 10; }
.sk-card { pointer-events: none; }
.sk-card:hover { transform: none; box-shadow: var(--shadow); }
.sk-ribbon { height: 38px; background: rgba(150, 58, 37, .12); }
.sk-line { display: block; height: 12px; border-radius: 6px; background: rgba(150, 58, 37, .10); margin: 4px 0; }
.sk-line.short { width: 55%; }
.sk-rows { display: grid; gap: 12px; }
.sk-row { border-radius: 14px; padding: 16px; min-height: 84px; }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; opacity: 0; } }

/* ==========================================================
   شمل بوت v2: حركات عفوية + انبثاق من زر الشعار
   ========================================================== */
/* حركات الوجه العفوية (تُفعَّل بـ data-act من bot.js وهو في الحالة العادية فقط) */
.mascot[data-mood="idle"][data-act="hop"] { animation: sb-hop .9s cubic-bezier(.3, .8, .4, 1); }
.mascot[data-mood="idle"][data-act="wiggle"] { animation: sb-wiggle 1.1s ease-in-out; }
.mascot[data-mood="idle"][data-act="nod"] { animation: sb-nod 1s ease-in-out; }
.mascot[data-mood="idle"][data-act="pulse"] { animation: sb-pulse 1.2s ease-in-out; }
.mascot[data-mood="idle"][data-act="spin"] { animation: sb-spin 1s cubic-bezier(.5, 0, .3, 1); }
.mascot[data-mood="idle"][data-act="sleepy"] .m-eye { animation: sb-sleepy 2.6s ease-in-out; }
.mascot[data-mood="idle"][data-act="sleepy"] .m-smile { display: none; }
.mascot[data-mood="idle"][data-act="sleepy"] .m-flat { display: inline; }
.mascot[data-mood="idle"][data-act="happy"] .m-eye { animation: sb-happy 1.5s ease-in-out; }
.mascot[data-mood="idle"][data-act="happy"] .m-smile { transform-box: fill-box; transform-origin: center; animation: sb-grin 1.5s ease-in-out; }
.mascot[data-mood="idle"][data-act="happy"] { animation: sb-hop 1.5s ease-in-out; }
@keyframes sb-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 20% { transform: translateY(1px) scale(1.06, .92); } 50% { transform: translateY(-7px) scale(.96, 1.06); } 80% { transform: translateY(0) scale(1.04, .96); } }
@keyframes sb-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-7deg); } 45% { transform: rotate(6deg); } 70% { transform: rotate(-4deg); } }
@keyframes sb-nod { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(3px); } 50% { transform: translateY(0); } 75% { transform: translateY(3px); } }
@keyframes sb-pulse { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.1); } 60% { transform: scale(1.02); } 80% { transform: scale(1.07); } }
@keyframes sb-spin { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(.92); } 100% { transform: rotate(360deg) scale(1); } }
@keyframes sb-sleepy { 0%, 100% { transform: scaleY(1); } 30%, 75% { transform: scaleY(.18); } }
@keyframes sb-happy { 0%, 100% { transform: scale(1); } 25%, 75% { transform: scale(1.08, .55); } }
@keyframes sb-grin { 0%, 100% { transform: scale(1); } 30%, 75% { transform: scale(1.12, 1.25); } }

/* الزر الثابت */
.sb-fab { bottom: calc(16px + env(safe-area-inset-bottom)); position: fixed; }
.sb-fab.attn::before { content: ""; position: absolute; inset: 0; border-radius: 999px; pointer-events: none; animation: sb-ring 2.6s ease-out infinite; }
@keyframes sb-ring { 0% { box-shadow: 0 0 0 0 rgba(150, 58, 37, .35); } 70%, 100% { box-shadow: 0 0 0 16px rgba(150, 58, 37, 0); } }
.sb-fab.out { animation: sb-fab-out .2s ease-in forwards; }
.sb-fab.in { animation: sb-fab-in .4s cubic-bezier(.2, .9, .3, 1.4) .1s both; }
@keyframes sb-fab-out { to { opacity: 0; transform: scale(.4) translateY(8px); } }
@keyframes sb-fab-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }

/* تلميحة لفت الانتباه */
.sb-tip { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 89; display: flex; align-items: center; gap: 8px; background: #fff; padding: 9px 12px 9px 8px; border-radius: 16px; font-weight: 700; font-size: .9rem; box-shadow: 0 8px 28px rgba(60, 30, 20, .22); cursor: pointer; animation: sb-tip-in .4s cubic-bezier(.2, .9, .3, 1.3) both; }
.sb-tip::after { content: ""; position: absolute; bottom: -6px; right: 26px; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); border-radius: 3px; }
.sb-tip button { width: 22px; height: 22px; border-radius: 50%; background: #f1e9e2; line-height: 1; color: #6b5f57; }
.sb-tip[hidden], .sb-backdrop[hidden] { display: none; }
@keyframes sb-tip-in { from { opacity: 0; transform: translateY(10px) scale(.9); } to { opacity: 1; transform: none; } }

/* النافذة: تنبثق من زاوية الزر */
.sb-panel { transform-origin: bottom right; bottom: calc(16px + env(safe-area-inset-bottom)); animation: sb-open .42s cubic-bezier(.2, .9, .3, 1.12) both; }
.sb-panel.closing { animation: sb-close .22s ease-in both; pointer-events: none; }
@keyframes sb-open { from { opacity: 0; transform: translateY(18px) scale(.3); border-radius: 60px; } 55% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes sb-close { to { opacity: 0; transform: translateY(14px) scale(.35); border-radius: 60px; } }
.sb-backdrop { position: fixed; inset: 0; z-index: 94; background: rgba(40, 15, 8, .42); backdrop-filter: blur(2px); animation: sb-fade .25s both; }
@keyframes sb-fade { from { opacity: 0; } to { opacity: 1; } }
body.sb-lock { overflow: hidden; }
.sb-opt { animation: sb-opt-in .32s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes sb-opt-in { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }
.sb-on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #4cd08a; margin-inline-end: 6px; animation: sb-ring-g 2s infinite; }
@keyframes sb-ring-g { 0% { box-shadow: 0 0 0 0 rgba(76, 208, 138, .6); } 80%, 100% { box-shadow: 0 0 0 7px rgba(76, 208, 138, 0); } }
.sb-bits { margin-top: 6px; font-size: .82rem; color: #7a6f68; }
.sb-msg small { color: #8a7f77; }
.sb-opts { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }

/* الجوال: ورقة تنزلق من تحت */
@media (max-width: 560px) {
  .sb-panel { left: 8px; right: 8px; width: auto; height: min(84dvh, 660px); transform-origin: bottom center; border-radius: 22px; animation-name: sb-sheet-in; }
  .sb-panel.closing { animation-name: sb-sheet-out; }
}
@keyframes sb-sheet-in { from { opacity: 0; transform: translateY(40px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sb-sheet-out { to { opacity: 0; transform: translateY(40px) scale(.96); } }
@media (prefers-reduced-motion: reduce) {
  .sb-panel, .sb-panel.closing, .sb-fab.in, .sb-fab.out, .sb-opt, .sb-tip, .sb-backdrop, .sb-fab.attn::before { animation: none !important; }
  .mascot[data-act], .mascot[data-act] * { animation: none !important; }
}
.sb-title small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* لمعة التحميل تحت أغلفة الصور دائمًا: تظهر قبل ما تنرسم الصورة وتختفي تحتها بعد الرسم (CSS فقط) */
.card .cover, .p-cover { position: relative; background: rgba(150, 58, 37, .08); }
.card .cover::after, .p-cover::after { content: ""; position: absolute; left: -15%; width: 130%; top: 0; height: 45%; pointer-events: none; z-index: 0;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .85) 50%, transparent);
  transform: translateY(-130%) rotate(-7deg); animation: skel-sweep 1.5s ease-in-out infinite; }
.card .cover > img, .card .cover > .poster, .p-cover > img, .p-cover > .poster { position: relative; z-index: 1; }
.card .cover.skel::after { z-index: 2; }
.p-hero .p-cover.skel { background: rgba(255, 255, 255, .12); }
.p-hero .sk-line { background: rgba(255, 255, 255, .16); }
.sk-hero { padding: 40px 0; }
@media (prefers-reduced-motion: reduce) { .card .cover::after, .p-cover::after { animation: none; opacity: 0; } }

/* 404 → صفحة عمل Firebase: نخفي الخطأ من أول لحظة ونعرض هيكلاً يطابق صفحة العمل */
.nf-skel { display: none; }
html.nf-wait .nf-skel { display: block; }
html.nf-wait main > :not(.nf-skel) { display: none; }
.p-hero .skel { background: rgba(255, 255, 255, .14); }
.p-hero .skel::after { background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .38) 50%, transparent); }
.p-hero .sk-line { background: rgba(255, 255, 255, .2); }
.p-hero .sk-line { margin: 12px 0; }
/* الجوال: الهيكل يطابق تخطيط الصفحة (غلاف في الوسط ونص متمركز) */
.p-cover { width: 100%; }
@media (max-width: 860px) {
  .p-hero .sk-line { margin-inline: auto; }
  .p-hero .p-info .sk-line:nth-child(1) { width: 70% !important; }
}

/* ---------- التواصل والحساب ---------- */
.dept-badge { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--dc) 14%, #fff); color: var(--dc); flex: none; }
.dept-badge .icon { width: 22px; height: 22px; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.dept-opt { display: flex; align-items: center; gap: 10px; text-align: start; padding: 10px 12px; border: 1.5px solid #dcd3ca; border-radius: 14px; background: #fff; min-height: 58px; transition: border-color .15s, background .15s; }
.dept-opt b { display: block; font-size: .92rem; line-height: 1.3; } .dept-opt small { color: #7a6f68; font-size: .78rem; display: block; line-height: 1.3; }
.dept-opt:hover { border-color: var(--primary); }
.dept-opt.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary-soft); }
.route { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #faf6f1; font-size: .92rem; }
.route b { direction: ltr; unicode-bidi: plaintext; color: var(--primary); }
.cform .note { font-size: .85rem; color: #7a6f68; }
.ok-box { text-align: center; padding: 34px 20px; display: grid; gap: 10px; justify-items: center; }
.ok-box .big { width: 64px; height: 64px; border-radius: 50%; background: #e6f4ea; color: #1e6b34; display: grid; place-items: center; font-size: 2rem; }
.ok-box .ref { background: #faf6f1; border-radius: 10px; padding: 8px 18px; font-weight: 800; direction: ltr; letter-spacing: 2px; }
.acc-tabs { display: flex; gap: 6px; margin-bottom: 14px; } .acc-tabs button { flex: 1; padding: 10px; border-radius: 999px; background: #fff; border: 1.5px solid rgba(150, 58, 37, .25); font-weight: 700; min-height: 44px; }
.acc-tabs button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.code-in { text-align: center; font-size: 1.8rem !important; letter-spacing: 10px; direction: ltr; font-weight: 800; }
.link-btn { background: none; border: 0; color: var(--primary); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; padding: 8px 4px; min-height: 40px; }
.link-btn:disabled { color: #9a8f86; text-decoration: none; cursor: default; }
.mlist { display: grid; gap: 10px; }
.mitem { background: #fff; border-radius: 14px; padding: 14px; box-shadow: var(--shadow); display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.mitem h4 { margin: 0 0 2px; } .mitem small { color: #7a6f68; }
.st { font-size: .75rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #fff3d6; color: #8a5a00; }
.st.read { background: #e8eefc; color: #2b4a9a; } .st.replied { background: #e6f4ea; color: #1e6b34; }
.who-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; padding: 14px 18px; border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 16px; }
.who-bar .ver { color: #1e6b34; font-weight: 700; font-size: .85rem; }
.contact-side { display: grid; gap: 10px; margin-top: 18px; }
.contact-side .row { display: flex; align-items: center; gap: 10px; font-size: .95rem; } .contact-side a { direction: ltr; unicode-bidi: plaintext; color: var(--primary); font-weight: 700; }
@media (max-width: 700px) { .nav .nav-x { display: none; } }
