/* ============================================================
   phone-rails.css — الموبايل بس (≤767px + html.phone-app)
   الخدمات والنتائج بقوا شرايط بتتسحب بالعرض (اللوحة 01: B و C).
   العناصر الجديدة بيعملها phone-rails.js، ومن غيره مالهاش وجود.
   الكمبيوتر: ولا قاعدة من هنا بتلمسه (غير الإخفاء اللي تحت).
   ============================================================ */

/* العناصر الجديدة مستخبية في أي مكان غير الموبايل */
.rl-dots,
.rl-unsure,
.rl-rx { display: none; }

@media (max-width: 767px) {

  /* ---------- الشريط: نفس الوصفة للاتنين ---------- */
  html.phone-app.rl-on .rl-rail {
    --rl-g: var(--pad-x);
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    width: auto;
    margin-inline: calc(-1 * var(--rl-g));
    padding-inline: var(--rl-g);
    padding-block: 4px 14px;
    scroll-padding-inline: var(--rl-g);
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y; /* pan-x لوحده بلع السحب لفوق والصفحة وقفت (موقع محمد ياسر 2026-10-05) */
  }
  html.phone-app.rl-on .rl-rail::-webkit-scrollbar { display: none; }
  html.phone-app.rl-on .rl-rail > * {
    flex: 0 0 min(calc((100% + 2 * var(--rl-g)) * .84), 440px);
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  /* النقط: هدف 44 بكسل حوالين نقطة 7 بكسل، والحالية بتطول ليموني */
  html.phone-app.rl-on .rl-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    margin-top: -6px;
  }
  html.phone-app.rl-on .rl-dot {
    width: 44px;
    height: 44px;
    flex: none;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  html.phone-app.rl-on .rl-dot::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--glass-brd-hi);
    transition: width .3s var(--ease), background-color .3s var(--ease);
  }
  html.phone-app.rl-on .rl-dot.is-on::before { width: 22px; background: var(--accent); }
  html.phone-app.rl-on .rl-dot:focus-visible { outline: none; }
  html.phone-app.rl-on .rl-dot:focus-visible::before { box-shadow: 0 0 0 3px var(--tint-34); }

  /* ---------- 1. الخدمات: كروت «إذا كنت…» ---------- */
  html.phone-app.rl-on #services .shead { text-align: center; }
  html.phone-app.rl-on .sc.rl-svc { align-items: stretch; }
  html.phone-app.rl-on .rl-svc .sc__card {
    padding: 18px 18px 16px;
    border-radius: 22px;
    border-color: var(--glass-brd);
    box-shadow: none;
    transition: border-color .3s var(--ease);
  }
  html.phone-app.rl-on[data-theme="light"] .rl-svc .sc__card { box-shadow: 0 6px 14px rgba(26,26,18,.07); border-color: var(--glass-brd); }
  html.phone-app.rl-on .rl-svc .sc__card.rl-cur { border-color: var(--tint-34); }
  html.phone-app.rl-on .rl-svc .sc__card--hot::before { inset-inline: 18px; }
  html.phone-app.rl-on .rl-svc .sc__if { font-size: 12.5px; }
  html.phone-app.rl-on .rl-svc .sc__who { margin-top: 4px; min-height: 0; font-size: 16px; line-height: 1.55; }
  html.phone-app.rl-on .rl-svc .sc__h { margin-top: 14px; padding-top: 14px; font-size: 18px; line-height: 1.4; }
  html.phone-app.rl-on .rl-svc .sc__chip { margin-top: 8px; padding: 3px 11px; font-size: 12px; }
  html.phone-app.rl-on .rl-svc .sc__list { gap: 9px; margin-top: 14px; }
  html.phone-app.rl-on .rl-svc .sc__list li { font-size: 13.5px; line-height: 1.5; }
  html.phone-app.rl-on .rl-svc .sc__foot {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--glass-brd);
    align-items: center;
    gap: 10px;
  }
  /* مسافة ثابتة قبل الخط اللي فوق «الشكل» حتى في الكارت الأطول */
  html.phone-app.rl-on .rl-svc .sc__list { margin-bottom: 16px; }
  html.phone-app.rl-on .rl-svc .sc__fmt { flex: 1 1 auto; }
  html.phone-app.rl-on .rl-svc .sc__fmt small { font-size: 11px; }
  html.phone-app.rl-on .rl-svc .sc__fmt b { min-height: 0; font-size: 13px; }
  html.phone-app.rl-on .rl-svc .sc__go {
    min-height: 44px;
    padding: 0 15px;
    gap: 6px;
    font-size: 13.5px;
    white-space: nowrap;
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
  }
  html.phone-app.rl-on .rl-svc .sc__go svg { width: 16px; height: 16px; }

  /* «مش متأكد؟» */
  html.phone-app.rl-on .rl-unsure {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    margin-top: 4px;
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--glass-brd);
    color: var(--text-2);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  html.phone-app.rl-on .rl-unsure:active { border-color: var(--tint-34); }
  html.phone-app.rl-on .rl-unsure:focus-visible { outline: 2px solid var(--accent-txt); outline-offset: 3px; }
  html.phone-app.rl-on .rl-unsure__q {
    flex: none;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--glass-brd);
    color: var(--accent-txt);
  }
  html.phone-app.rl-on .rl-unsure__q svg { width: 19px; height: 19px; }
  html.phone-app.rl-on .rl-unsure__t { flex: 1 1 auto; min-width: 0; font-size: 13.5px; line-height: 1.5; }
  html.phone-app.rl-on .rl-unsure__t b { display: block; font-size: 14.5px; font-weight: 700; color: var(--text); }
  html.phone-app.rl-on .rl-unsure__ch { flex: none; display: grid; place-items: center; color: var(--text-2); }
  html.phone-app.rl-on .rl-unsure__ch svg { width: 18px; height: 18px; }
  html.phone-app.rl-on[dir="rtl"] .rl-unsure__ch svg { transform: scaleX(-1); }

  /* ---------- 2. النتائج: كارت لكل حملة ---------- */
  /* الأداة بتاعة الكمبيوتر (اللقطة الكبيرة + الزراير) مستخبية — الشريط بداله */
  html.phone-app.rl-on.rl-rx-on #results .rx__stage { display: none; }
  html.phone-app.rl-on .rl-rx { display: block; }

  html.phone-app.rl-on .rl-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--glass-brd);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .3s var(--ease);
  }
  html.phone-app.rl-on[data-theme="light"] .rl-card { box-shadow: 0 6px 14px rgba(26,26,18,.07); }
  html.phone-app.rl-on .rl-card.rl-cur { border-color: var(--tint-34); }
  html.phone-app.rl-on .rl-card:focus-visible { outline: 2px solid var(--accent-txt); outline-offset: -2px; }

  html.phone-app.rl-on .rl-shot {
    position: relative;
    height: 136px;
    overflow: hidden;
    background: #fff;
    border-bottom: 1px solid var(--glass-brd);
    direction: ltr;            /* اللقطة إنجليزي: الصرف شمال والمبيعات يمين */
  }
  html.phone-app.rl-on .rl-shot img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: none;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
  }
  html.phone-app.rl-on .rl-real {
    position: absolute;
    z-index: 3;
    top: 9px;
    inset-inline-start: 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: #0A0A0B;
    color: #C4F82A;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
  }
  /* الشريحة نفسها ltr، فالكبسولة تتحط في أول سطر اللغة يدويًا */
  html.phone-app.rl-on[dir="rtl"] .rl-real { left: auto; right: 9px; direction: rtl; }
  html.phone-app.rl-on[dir="ltr"] .rl-real { left: 9px; right: auto; }
  html.phone-app.rl-on .rl-real i { width: 5px; height: 5px; border-radius: 50%; background: #C4F82A; }
  html.phone-app.rl-on .rl-tag {
    position: absolute;
    z-index: 2;
    height: 20px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #0A0A0B;
    color: #F5F5F4;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(10,10,11,.25);
  }
  html.phone-app.rl-on .rl-tag--out { background: #C4F82A; color: #0A0A0B; }

  html.phone-app.rl-on .rl-body { padding: 12px 14px 14px; }
  html.phone-app.rl-on .rl-flow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  html.phone-app.rl-on .rl-side { display: flex; flex-direction: column; min-width: 0; }
  html.phone-app.rl-on .rl-side small { font-size: 11px; font-weight: 600; color: var(--text-3); }
  html.phone-app.rl-on .rl-side b { font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--text); }
  html.phone-app.rl-on .rl-side--out { text-align: end; }
  html.phone-app.rl-on .rl-side--out b { color: var(--accent-txt); }
  html.phone-app.rl-on .rl-n {
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
  }
  html.phone-app.rl-on .rl-arr { flex: 1 1 auto; min-width: 24px; height: 10px; margin-top: 14px; color: var(--accent-txt); opacity: .8; }
  html.phone-app.rl-on .rl-arr svg { display: block; width: 100%; height: 10px; }
  html.phone-app.rl-on[dir="rtl"] .rl-arr svg { transform: scaleX(-1); }

  html.phone-app.rl-on .rl-big {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--glass-brd);
  }
  html.phone-app.rl-on .rl-big > b { flex: none; font-size: 38px; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--text); }
  html.phone-app.rl-on .rl-big > b em { margin-inline-start: 1px; font-style: normal; font-size: 26px; color: var(--accent-txt); }
  html.phone-app.rl-on .rl-big > span { min-width: 0; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
  html.phone-app.rl-on .rl-big small { display: block; font-size: 11px; color: var(--text-3); }

  /* ---------- «ونتايج تانية»: نفس العناصر، كسطور ---------- */
  html.phone-app #results .rx__more {
    display: block;
    margin-top: 14px;
    padding-top: 0;
    border-top: 0;
  }
  html.phone-app #results .rx__moreT {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
  }
  html.phone-app #results .rx__moreT::before {
    content: '';
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-txt);
    box-shadow: 0 0 0 4px var(--tint-12);
  }
  html.phone-app #results .rx__more ul {
    display: block;
    margin: 0;
    padding: 0 14px;
    list-style: none;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--glass-brd);
  }
  html.phone-app #results .rx__more li,
  html.phone-app #results .rx__more li:first-child,
  html.phone-app #results .rx__more li:nth-child(3n+1) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 8px 0;
    border-inline-start: 0;
    border-top: 1px solid var(--glass-brd);
  }
  html.phone-app #results .rx__more li:first-child { border-top: 0; }
  html.phone-app #results .res__v { flex: none; flex-wrap: nowrap; align-items: baseline; gap: 4px; white-space: nowrap; }
  html.phone-app #results .res__v b { font-size: 16px; color: var(--text); letter-spacing: -.01em; }
  html.phone-app #results .res__v--word b { font-size: 14px; color: var(--accent-txt); }
  html.phone-app #results .res__v em { font-size: 12px; font-weight: 600; color: var(--accent-txt); }
  html.phone-app #results .res__v em:empty { display: none; }
  html.phone-app #results .res__l {
    min-width: 0;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--text-2);
    text-align: end;
  }

  @media (prefers-reduced-motion: reduce) {
    html.phone-app.rl-on .rl-rail { scroll-behavior: auto; }
    html.phone-app.rl-on .rl-dot::before,
    html.phone-app.rl-on .rl-card,
    html.phone-app.rl-on .rl-svc .sc__card { transition: none; }
  }
}
