/* ═══════════════════════════════════════════════════════════════
   رفيق الدراسة — الأنماط
   عربي RTL · أزرار كبيرة مناسبة للتابلت · تباين عالٍ
   ═══════════════════════════════════════════════════════════════ */

:root {
  --brand:        #5b5ce4;
  --brand-dark:   #4340c4;
  --brand-soft:   #eeeefc;
  --accent:       #ffb020;
  --success:      #16a34a;
  --danger:       #dc2626;

  --ink:          #1b2140;
  --ink-2:        #4a5170;
  --muted:        #7b829c;
  --line:         #e6e8f2;
  --card:         #ffffff;

  --radius:       22px;
  --radius-sm:    14px;
  --shadow:       0 10px 30px rgba(27, 33, 64, .08);
  --shadow-lg:    0 18px 45px rgba(27, 33, 64, .14);
  --tap:          56px;              /* أدنى مقاس لمس مناسب للأطفال */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* سمة hidden يجب أن تتغلّب على display:grid/flex للعناصر */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Tajawal", "Cairo", "Segoe UI", "Noto Kufi Arabic", system-ui, sans-serif;
  background: linear-gradient(165deg, #f4f6ff 0%, #eef1fe 45%, #f7f4ff 100%);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}

.shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 22px 18px 40px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ─── الترويسة ─────────────────────────────────────────────── */
.brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 26px;
}
.brand__logo {
  width: 52px; height: 52px; flex: none;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--brand), #8b7bf0);
  display: grid; place-items: center;
  font-size: 26px;
  box-shadow: 0 8px 20px rgba(91, 92, 228, .35);
}
.brand__name { font-size: 1.35rem; font-weight: 800; letter-spacing: -.2px; }
.brand__sub  { font-size: .82rem; color: var(--muted); margin-top: -6px; }

/* ─── العناوين ─────────────────────────────────────────────── */
h1 { font-size: 1.6rem; font-weight: 800; margin: 0 0 6px; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 14px; }
.lead { color: var(--ink-2); margin: 0 0 26px; }

/* ─── نموذج دخول الأسرة ───────────────────────────────────── */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  max-width: 420px;
}
.panel label {
  display: block;
  font-size: .88rem; font-weight: 700;
  color: var(--ink-2); margin-bottom: 6px;
}
.panel input {
  width: 100%;
  padding: 14px 15px;
  font: inherit; font-size: 1.05rem;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: #fbfbff; color: var(--ink);
  min-height: var(--tap);
}
.panel input:focus { outline: none; border-color: var(--brand); background: #fff; }

.btn--out {
  color: var(--danger); border-color: #f3d3d3;
  white-space: nowrap; padding: 0 16px;
  min-height: 46px; font-size: .95rem;
}
.btn--out:hover { background: #fdeaea; }

.hint { font-size: .8rem; color: var(--muted); }

/* ─── تبويبات دخول/تسجيل ───────────────────────────────────── */
.tabs {
  display: flex; gap: 6px;
  background: #eef0f8; border-radius: 14px;
  padding: 5px; margin-bottom: 16px;
  max-width: 420px;
}
.tabs__btn {
  flex: 1; border: none; background: transparent;
  font: inherit; font-weight: 700; color: var(--ink-2);
  padding: 11px 8px; border-radius: 10px; cursor: pointer;
  transition: background .15s, color .15s;
}
.tabs__btn.is-on { background: #fff; color: var(--brand-dark); box-shadow: var(--shadow); }
/* فصلٌ لا يشمله الاشتراك — باهتٌ لكنه مرئيّ ونقرتُه تشرح السبب */
.tabs__btn.is-locked { opacity: .5; cursor: not-allowed; }

.panel .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel select {
  width: 100%; padding: 13px 12px; font: inherit; font-size: 1rem;
  border: 1.5px solid var(--line); border-radius: 13px;
  background: #fbfbff; color: var(--ink); min-height: var(--tap);
}

/* ─── بطاقة الدفع ──────────────────────────────────────────── */
.pay-card {
  background: var(--card); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow);
  max-width: 440px; text-align: center;
}
.pay-card__icon  { font-size: 3rem; line-height: 1; }
.pay-card__title { font-size: 1.25rem; font-weight: 800; margin-top: 8px; }
.pay-card__kind  {
  display: inline-block; margin-top: 8px;
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: .8rem; font-weight: 700; padding: 4px 14px; border-radius: 999px;
}
.pay-amount {
  margin: 20px 0; font-weight: 800; color: var(--brand-dark);
  font-size: 2.6rem; line-height: 1;
}
.pay-amount__cur { font-size: 1.3rem; }
.pay-amount__per { display: block; font-size: .85rem; color: var(--muted); font-weight: 500; margin-top: 6px; }

.pay-feats {
  list-style: none; padding: 0; margin: 0 0 22px;
  text-align: right; display: grid; gap: 8px;
}
.pay-feats li {
  background: #f7f8fd; border-radius: 12px; padding: 10px 14px;
  font-size: .9rem; color: var(--ink-2);
}

/* ─── بطاقات الأطفال ───────────────────────────────────────── */
.child-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}
.child-card {
  background: var(--card);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 24px 14px 20px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  font: inherit; color: inherit;
  min-height: 168px;
}
.child-card:hover, .child-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: var(--shadow-lg);
  outline: none;
}
.child-card__icon {
  font-size: 3.1rem; line-height: 1;
  display: block; margin-bottom: 10px;
}
.child-card__name  { display: block; font-weight: 800; font-size: 1.15rem; }
.child-card__grade { display: block; font-size: .84rem; color: var(--muted); }

/* ─── لوحة الرمز السرّي ────────────────────────────────────── */
.sheet {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20, 24, 48, .55);
  backdrop-filter: blur(4px);
  display: grid; place-items: end center;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
}
.sheet.is-open { opacity: 1; pointer-events: auto; }

.sheet__panel {
  background: var(--card);
  width: 100%; max-width: 430px;
  border-radius: 26px 26px 0 0;
  padding: 22px 22px 30px;
  transform: translateY(22px);
  transition: transform .26s cubic-bezier(.2,.9,.3,1);
  box-shadow: var(--shadow-lg);
}
.sheet.is-open .sheet__panel { transform: translateY(0); }

@media (min-width: 560px) {
  .sheet { place-items: center; }
  .sheet__panel { border-radius: 26px; }
}

.sheet__who { text-align: center; margin-bottom: 4px; }
.sheet__who span { font-size: 2.4rem; }
.sheet__title { text-align: center; font-weight: 800; font-size: 1.1rem; }
.sheet__hint  { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 16px; }

.pin-dots {
  display: flex; justify-content: center; gap: 14px;
  margin: 4px 0 20px;
}
.pin-dots i {
  width: 17px; height: 17px; border-radius: 50%;
  background: #dfe2f0; transition: background .15s, transform .15s;
}
.pin-dots i.on { background: var(--brand); transform: scale(1.18); }
.pin-dots.shake { animation: shake .38s; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-9px); }
  75%     { transform: translateX(9px); }
}

.pinpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pinpad button {
  min-height: var(--tap);
  font: inherit; font-size: 1.45rem; font-weight: 700;
  border: 1.5px solid var(--line);
  background: #fbfbff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s, transform .12s;
}
.pinpad button:active { background: var(--brand-soft); transform: scale(.95); }
.pinpad button.is-util { font-size: 1.05rem; color: var(--ink-2); }

/* ─── اختيار مصدر الصورة ──────────────────────────────────── */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.choice {
  display: block;
  background: #fbfbff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 12px 16px;
  cursor: pointer;
  font: inherit; color: inherit;
  text-align: center;
  transition: border-color .15s, transform .12s, background .15s;
  min-height: 128px;
}
.choice:hover, .choice:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: none;
}
.choice:active { transform: scale(.96); }

.choice__icon  { display: block; font-size: 2.3rem; line-height: 1; margin-bottom: 8px; }
.choice__label { display: block; font-weight: 800; font-size: 1rem; }
.choice__sub   { display: block; font-size: .78rem; color: var(--muted); }

#pickCancel { width: 100%; }

/* ─── شاشة المواد ─────────────────────────────────────────── */
.greet {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 22px;
}
.greet__text h1 { margin-bottom: 0; }
.greet__text p  { margin: 0; color: var(--muted); font-size: .88rem; }

.points-pill {
  background: linear-gradient(135deg, #fff5e0, #ffe9bd);
  border: 1.5px solid #ffdb95;
  color: #96560a;
  font-weight: 800;
  padding: 9px 16px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: .95rem;
}

.subject-grid { display: grid; gap: 14px; }

.subject-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer; text-align: right;
  font: inherit; color: inherit;
  box-shadow: var(--shadow);
  min-height: 84px;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.subject-card:hover, .subject-card:focus-visible {
  transform: translateX(-5px);
  box-shadow: var(--shadow-lg);
  outline: none;
}
.subject-card__emoji {
  width: 54px; height: 54px; flex: none;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 1.75rem;
  background: var(--brand-soft);
}
.subject-card__body { display: block; flex: 1; min-width: 0; }
.subject-card__name { display: block; font-weight: 800; font-size: 1.1rem; }
.subject-card__meta { display: block; font-size: .82rem; color: var(--muted); line-height: 1.4; }
.subject-card__go   { color: var(--muted); font-size: 1.5rem; flex: none; }

.badge-new {
  display: inline-block;   /* لا يتّصل آخر حرف في اسم المادة بـ«جديد» في كروم («رياضياٮ») — ٢٠٢٦-١١-٢١ */
  background: var(--brand); color: #fff;
  font-size: .7rem; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  margin-inline-start: 8px;
  vertical-align: middle;
}

/* ─── المحادثة ─────────────────────────────────────────────── */
.chat-page { padding-bottom: 0; }

.chat-head {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  position: sticky; top: 10px; z-index: 20;
}
.chat-head__emoji { font-size: 1.6rem; }
.chat-head__title { font-weight: 800; }
.chat-head__sub   { font-size: .78rem; color: var(--muted); margin-top: -4px; }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  border: none; background: var(--brand-soft);
  border-radius: 13px; cursor: pointer;
  font-size: 1.2rem; color: var(--brand-dark);
  display: grid; place-items: center;
}
.icon-btn:active { transform: scale(.93); }

.stream {
  flex: 1;
  display: flex; flex-direction: column; gap: 14px;
  padding: 6px 2px 18px;
  overflow-anchor: none;
}

/* position + pan-y أساس الردّ بالسحب: الأول يثبّت سهم الردّ خارج الجزء
   المتحرّك، والثاني يترك التمرير الرأسي للمتصفّح ويسلّمنا الأفقي وحده. */
.msg {
  display: flex; gap: 10px; max-width: 88%;
  position: relative;
  touch-action: pan-y;
}
.msg--bot { align-self: flex-start; }
.msg--me  { align-self: flex-end; flex-direction: row-reverse; }

/* المتحرّك هو المحتوى لا ‎.msg‎ نفسها، وإلا تحرّك السهم معها فلم يظهر */
.msg__ava, .msg .bubble { transform: translateX(var(--swipe, 0px)); }
.msg:not(.is-swiping) .msg__ava,
.msg:not(.is-swiping) .bubble { transition: transform .18s ease-out; }

.msg__swipe {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 1rem;
  opacity: 0; pointer-events: none;
}
.msg.is-armed .msg__swipe {
  background: var(--brand); color: #fff;
  transform: translateY(-50%) scale(1.12);
}

/* الرسالة المقتبَسة داخل الفقاعة */
.quote {
  border-inline-start: 3px solid var(--brand);
  background: rgba(91, 92, 228, .07);
  border-radius: 8px;
  padding: 6px 9px; margin-bottom: 8px;
  font-size: .82rem; line-height: 1.5;
  color: var(--ink-2);
  white-space: normal;
}
.quote__who { display: block; font-weight: 700; color: var(--brand-dark); }
/* داخل فقاعة الطفل الخلفية بنفسجية داكنة، فالألوان تُقلب لتبقى مقروءة */
.msg--me .quote {
  border-inline-start-color: rgba(255, 255, 255, .75);
  background: rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .92);
}
.msg--me .quote__who { color: #fff; }

.msg__ava {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px; display: grid; place-items: center;
  font-size: 1.15rem;
  background: linear-gradient(140deg, var(--brand), #8b7bf0);
  color: #fff;
}
.msg--me .msg__ava { background: #e9ecf7; color: var(--ink-2); }

.bubble {
  background: var(--card);
  padding: 13px 17px;
  border-radius: 20px 20px 20px 6px;
  box-shadow: 0 4px 14px rgba(27, 33, 64, .07);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* الذيل الصغير في اتجاه الأفاتار: المساعد على اليمين، الطفل على اليسار (RTL) */
.msg--bot .bubble { border-radius: 20px 20px 6px 20px; }
.msg--me .bubble {
  background: var(--brand);
  color: #fff;
  border-radius: 20px 20px 20px 6px;
}
.bubble b { font-weight: 800; }
.bubble img {
  display: block;
  max-width: 210px; width: 100%;
  border-radius: 12px;
  margin-bottom: 8px;
}

.typing .bubble { display: flex; gap: 5px; padding: 17px; }
.typing i {
  width: 8px; height: 8px; border-radius: 50%;
  background: #bfc4dc;
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .3 } 30% { opacity: 1 } }

/* ─── الشرائح السريعة ─────────────────────────────────────── */
.chips {
  display: flex; gap: 9px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none;
  background: #fff; border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 9px 15px;
  font: inherit; font-size: .88rem;
  color: var(--ink-2); cursor: pointer;
  white-space: nowrap;
}
.chips button:active { background: var(--brand-soft); }

/* ─── صندوق الكتابة ───────────────────────────────────────── */
.composer {
  position: sticky; bottom: 0;
  background: linear-gradient(to top, #f2f4ff 62%, rgba(242,244,255,0));
  padding: 10px 0 14px;
}
.composer__box {
  display: flex; align-items: flex-end; gap: 9px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
}
.composer textarea {
  flex: 1; border: none; outline: none; resize: none;
  font: inherit; font-size: 1rem;
  background: transparent;
  max-height: 130px; min-height: 40px;
  padding: 8px 6px;
  color: var(--ink);
}
.composer textarea::placeholder { color: #a7adc4; }

.btn-round {
  width: 48px; height: 48px; flex: none;
  border: none; border-radius: 50%;
  cursor: pointer; font-size: 1.25rem;
  display: grid; place-items: center;
  transition: transform .12s, opacity .12s;
}
.btn-round:active { transform: scale(.92); }
.btn-round--cam  { background: var(--brand-soft); color: var(--brand-dark); }
.btn-round--send { background: var(--brand); color: #fff; }
/* سهم الإرسال يتجه لليسار في الواجهة العربية */
.btn-round--send .ico { display: block; transform: scaleX(-1); }
.btn-round:disabled { opacity: .45; cursor: default; }

.reply-bar {
  display: none;
  align-items: center; gap: 10px;
  background: #fff; border: 1.5px solid var(--line);
  border-inline-start: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 8px 12px; margin-bottom: 9px;
}
.reply-bar.is-on { display: flex; }
.reply-bar__ico { color: var(--brand); font-size: 1.1rem; }
.reply-bar__body { flex: 1; min-width: 0; }
.reply-bar__who { font-size: .78rem; font-weight: 700; color: var(--brand-dark); }
.reply-bar__txt {
  font-size: .86rem; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reply-bar button {
  border: none; background: #f0f1f8; color: var(--ink-2);
  width: 32px; height: 32px; border-radius: 9px;
  cursor: pointer; font-size: .95rem; flex: none;
}

.preview {
  display: none;
  align-items: center; gap: 12px;
  background: #fff; border: 1.5px dashed var(--brand);
  border-radius: var(--radius-sm);
  padding: 9px 12px; margin-bottom: 9px;
}
.preview.is-on { display: flex; }
.preview img { width: 54px; height: 54px; object-fit: cover; border-radius: 10px; }
.preview span { flex: 1; font-size: .88rem; color: var(--ink-2); }
.preview button {
  border: none; background: #fdeaea; color: var(--danger);
  width: 36px; height: 36px; border-radius: 10px;
  cursor: pointer; font-size: 1rem;
}

/* ─── عناصر عامة ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap);
  padding: 0 26px;
  border: none; border-radius: 16px;
  background: var(--brand); color: #fff;
  font: inherit; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 8px 20px rgba(91, 92, 228, .3);
}
.btn:active { transform: translateY(1px); }
.btn--ghost {
  background: transparent; color: var(--ink-2);
  border: 1.5px solid var(--line); box-shadow: none;
}

.foot {
  margin-top: auto; padding: 26px 0 52px;
  text-align: center; font-size: .8rem; color: var(--muted);
}
.foot a { color: var(--brand-dark); }

.empty {
  background: #fff; border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 30px 22px; text-align: center; color: var(--ink-2);
}
.empty__icon { font-size: 2.4rem; display: block; margin-bottom: 8px; }

.skeleton {
  background: linear-gradient(90deg, #eef0f8 25%, #f7f8fd 50%, #eef0f8 75%);
  background-size: 300% 100%;
  animation: sweep 1.3s infinite;
  border-radius: var(--radius);
  min-height: 84px;
}
@keyframes sweep { 0% { background-position: 100% 0 } 100% { background-position: -100% 0 } }

/* ─── الشارة والرسائل العابرة ─────────────────────────────── */
.demo-badge {
  position: fixed; z-index: 50;
  inset-inline-start: 12px; bottom: 12px;
  background: rgba(27, 33, 64, .9); color: #fff;
  font-size: .74rem; padding: 7px 13px;
  border-radius: 999px;
  pointer-events: none;
  max-width: calc(100% - 24px);
}
.demo-badge b { font-weight: 700; }

.demo-badge--inline {
  position: static;
  align-self: center;
  margin: 0 auto 4px;
  background: rgba(27, 33, 64, .72);
}

.toast {
  position: fixed; z-index: 80;
  bottom: 22px; left: 50%;
  transform: translate(-50%, 22px);
  background: var(--ink); color: #fff;
  padding: 13px 22px; border-radius: 14px;
  font-size: .92rem; max-width: 90%;
  opacity: 0; transition: all .28s ease;
  box-shadow: var(--shadow-lg);
}
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.toast--error { background: #b91c1c; }
.toast--ok    { background: #15803d; }

/* ─── شاشات الجوال الضيّقة ────────────────────────────────── */
@media (max-width: 430px) {
  .shell { padding: 16px 14px 34px; }
  .greet { align-items: flex-start; gap: 10px; }
  .greet h1 { font-size: 1.35rem; }
  .btn--out { padding: 0 12px; font-size: .88rem; min-height: 42px; }
  .chat-head { padding: 10px 12px; gap: 9px; }
  .chat-head__title { font-size: .98rem; }
  .chat-head__sub {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%;
  }
  .points-pill { padding: 7px 12px; font-size: .85rem; }
  .icon-btn { width: 40px; height: 40px; }
  .msg { max-width: 94%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══════════════════════════════════════════════════════════════
   الاشتراك والفوترة
   ═══════════════════════════════════════════════════════════════ */

/* شريط حالة الاشتراك أعلى شاشة البطاقات */
.notice {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 18px;
  border-radius: var(--radius-sm);
  background: #fff8e8; border: 1.5px solid #f5dfae; color: #7a5310;
  font-size: .92rem; line-height: 1.6;
}
.notice--danger { background: #fdeaea; border-color: #f3c2c2; color: #8f1d1d; }
.notice--ok     { background: #e9f8ee; border-color: #bce3c9; color: #14602f; }
.notice__text   { flex: 1; min-width: 180px; }
.notice__text b { font-weight: 800; }
.notice .btn    { min-height: 42px; padding: 0 18px; font-size: .92rem; }

/* بطاقات محفوظة */
.card-list { display: grid; gap: 12px; margin: 4px 0 0; }
.saved-card {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff;
}
.saved-card__icon { font-size: 1.6rem; line-height: 1; }
.saved-card__body { flex: 1; min-width: 140px; }
.saved-card__num  { font-weight: 800; letter-spacing: .5px; direction: ltr; text-align: right; }
.saved-card__meta { font-size: .78rem; color: var(--muted); }
.saved-card .btn  { min-height: 42px; padding: 0 16px; font-size: .9rem; }

/* سطور الفاتورة */
.bill { border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.bill__row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.bill__row:last-child { border-bottom: none; }
.bill__row--total { background: var(--brand-soft); font-weight: 800; font-size: 1.02rem; }
/* تاريخ الانتهاء تحت الإجمالي — خبرٌ لا مبلغ، فيخفت عمداً */
.bill__row--note { font-size: .84rem; color: var(--muted); padding-top: 8px; padding-bottom: 10px; }
/* المبلغ يحمل نصاً عربياً («ر.ع / شهرياً») فيبقى RTL — الأرقام الهندية تُعرض صحيحة فيه */
.bill__row span:last-child { white-space: nowrap; }

/* مقياس استهلاك التكلفة */
.meter { margin-top: 4px; }
.meter__head {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: .82rem; color: var(--ink-2); margin-bottom: 6px;
}
.meter__head span:last-child { white-space: nowrap; }
.meter__bar { height: 9px; border-radius: 99px; background: #eceefa; overflow: hidden; }
.meter__fill { height: 100%; border-radius: 99px; background: var(--brand); transition: width .3s; }
.meter__fill.is-warn { background: var(--accent); }
.meter__fill.is-full { background: var(--danger); }

/* مفتاح التجديد التلقائي */
.switch-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
}
.switch-row__body { flex: 1; }
.switch-row__body b { display: block; font-weight: 800; }
.switch-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--brand); }

/* سجل الدفعات */
.pay-log { display: grid; gap: 10px; }
.pay-log__row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-size: .88rem;
}
.pay-log__when { color: var(--muted); font-size: .78rem; direction: ltr; }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: .74rem; font-weight: 700;
}
.tag--ok   { background: #e9f8ee; color: #14602f; }
.tag--wait { background: #fff8e8; color: #7a5310; }
.tag--off  { background: #f1f2f7; color: var(--muted); }

.section-title { margin: 26px 0 12px; font-size: 1.05rem; font-weight: 800; }

/* ═══════════════════════════════════════════════════════════════
   شريط تثبيت التطبيق
   يظهر أسفل الشاشة حين يسمح المتصفّح بالتثبيت، ويحترم
   منطقة الأمان في أجهزة الحافة المنحنية.
   ═══════════════════════════════════════════════════════════════ */
#installBar {
  position: fixed; z-index: 60;
  inset-inline: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  transform: translateY(140%);
  opacity: 0;
  transition: transform .32s cubic-bezier(.2, .8, .3, 1), opacity .32s;
}
#installBar.is-in { transform: translateY(0); opacity: 1; }

.install__txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.install__txt strong { font-size: .95rem; font-weight: 800; }
.install__txt span   { font-size: .78rem; color: var(--muted); }

.install__yes {
  flex-shrink: 0; padding: 11px 18px; border: 0;
  border-radius: 99px; background: var(--brand); color: #fff;
  font-family: inherit; font-size: .9rem; font-weight: 800; cursor: pointer;
}
.install__yes:active { transform: scale(.97); }

.install__no {
  flex-shrink: 0; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); font-size: 1rem; cursor: pointer;
}
.install__no:hover { background: var(--brand-soft); }

@media (min-width: 560px) {
  #installBar { inset-inline: auto 16px; max-width: 420px; }
}

/* ─── الباقات ───────────────────────────────────────────── */
/* الحدود داخل البطاقة تُكتب بالوحدات لا بالريال — انظر js/plans.js */
.plan-grid { display: grid; gap: 14px; margin: 4px 0 0; }

.plan {
  position: relative;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.plan:hover, .plan:focus-visible { border-color: #c9cbf3; transform: translateY(-2px); outline: none; }
.plan.is-on { border-color: var(--brand); box-shadow: var(--shadow-lg); cursor: default; }
.plan.is-featured:not(.is-on) { border-color: #dcd8fa; }

.plan__flag {
  position: absolute; top: -11px; inset-inline-start: 18px;
  background: var(--accent); color: #4a3200;
  font-size: .72rem; font-weight: 800;
  padding: 4px 12px; border-radius: 99px; white-space: nowrap;
}
.plan__flag--on   { background: var(--brand); color: #fff; }
.plan__flag--next { background: #e9f8ee; color: #14602f; inset-inline-start: auto; inset-inline-end: 18px; }

.plan__name  { margin: 6px 0 2px; font-size: 1.25rem; font-weight: 800; }
.plan__tag   { margin: 0 0 14px; font-size: .84rem; color: var(--muted); min-height: 2.2em; }

.plan__price { display: flex; align-items: baseline; gap: 6px; }
.plan__price b    { font-size: 2rem; font-weight: 800; color: var(--brand-dark); letter-spacing: -1px; }
.plan__price span { font-size: .85rem; color: var(--muted); font-weight: 500; }
.plan__extra { font-size: .82rem; color: var(--ink-2); margin-top: 2px; }

/* نافذة المدّة («سبتمبر إلى يناير») — تحت السعر مباشرةً لأنها جزء من
   معناه بعد أن صارت المدد مثبّتة على التقويم لا متدحرجة من الدفع */
.plan__window {
  margin-top: 3px; font-size: .78rem; font-weight: 600;
  color: var(--brand-dark); opacity: .78;
}

/* توفير الاشتراك السنوي — رقمٌ يُقنع فيستحقّ تمييزاً بصرياً */
.plan__save {
  margin-top: 6px; font-size: .8rem; font-weight: 700;
  color: #0a7d3f; background: #e8f7ee;
  border-radius: 8px; padding: 3px 8px; display: inline-block;
}

/* مبدّل المدّة (فصلي · سنوي) فوق بطاقات الباقات */
.period-switch {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface-2, #f1f3f8); border-radius: 12px;
}
.period-btn {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--ink-2);
  padding: 8px 16px; border-radius: 9px; line-height: 1.15;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.period-btn small { font-weight: 500; font-size: .72rem; opacity: .75; }
.period-btn.is-on {
  background: var(--surface, #fff); color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.btn--sm { padding: 5px 12px; font-size: .82rem; min-height: auto; }

.plan__feats { list-style: none; padding: 0; margin: 16px 0 18px; display: grid; gap: 9px; }
.plan__feats li {
  display: flex; align-items: baseline; gap: 8px;
  font-size: .88rem; color: var(--ink-2);
}
.plan__feats li span { flex: none; font-size: .95rem; }
.plan__feats li b    { color: var(--ink); font-weight: 800; }
.plan__feats li i    { font-style: normal; color: var(--muted); font-size: .78rem; }

.plan__pick { width: 100%; min-height: 46px; font-size: .95rem; }

@media (min-width: 640px) {
  .plan-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: start; }
  .plan__tag { min-height: 3.4em; }
}

/* ─── شريط الوحدات (يراه ولي الأمر قبل دخول الطالب) ─────── */
.units {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.units__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.units__title { font-weight: 800; font-size: .98rem; }
.units__plan {
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: .76rem; font-weight: 800; padding: 5px 12px; border-radius: 99px;
}
.units__rows { display: grid; gap: 12px; }
.units__num { font-variant-numeric: tabular-nums; }
.units__num b { font-weight: 800; }
.units__foot { margin: 12px 0 0; font-size: .78rem; color: var(--muted); }

/* ─── الرسم التوضيحي داخل فقاعة المعلّم ─────────────────── */
/* المحتوى SVG منقّى على الخادم (api/_draw.php) — لا تنقية في المتصفح */
.draw {
  margin: 12px 0 4px;
  padding: 10px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
}
.draw__svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 380px;         /* رسم طويل لا يبتلع الشاشة على الجوال */
  /* ⚠️ كان overflow:visible فكان أي عنصر يرسمه النموذج خارج viewBox
     يتسرّب فوق نصّ الفقاعة ويوسّع الصفحة أفقياً. القصّ عند الحدّ هو
     السلوك الصحيح: رسمٌ ناقص أهون من صفحة متداخلة. */
  overflow: hidden;
}
.draw__svg text { font-family: 'Tajawal', system-ui, sans-serif; }

/* ─── فتح الرسمة ────────────────────────────────────────── */
/* الرسمة داخل الفقاعة عرضها ~٢٥٠px على الجوال فملصقاتها لا تُقرأ:
   الضغط عليها نفسها يفتحها ملء الشاشة — بلا زرّ يأكل مساحة الفقاعة. */
.draw {
  cursor: zoom-in;
  /* ‎line-height: 0‎ يمنع أي عقدة نصّ فارغة من توليد صندوق سطر تحت الرسمة */
  line-height: 0;
}
.draw:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.draw:active { transform: scale(.995); }

body.no-scroll { overflow: hidden; }

.viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  flex-direction: column;
  background: rgba(12, 15, 34, .97);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.viewer.is-on { display: flex; }

.viewer__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}
.viewer__bar button {
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.viewer__bar button:active { background: rgba(255, 255, 255, .28); }
.viewer__x { font-size: 1.15rem; }
.viewer__zoom { display: flex; gap: 8px; margin-inline-start: auto; }
.viewer__zoom button:first-child,
.viewer__zoom button:last-child { font-size: 1.3rem; }

/* المسرح يأخذ ما بقي من الشاشة، والرسم يملؤه بلا هوامش مهدورة */
.viewer__stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;          /* التقريب والسحب لنا لا للمتصفّح */
  cursor: grab;
}
.viewer.is-zoomed .viewer__stage { cursor: grab; }

.viewer__art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
}
/* ⚠️ نُبطل max-height الموروثة من ‎.draw__svg‎ (٣٨٠px داخل الفقاعة):
   بدونها تبقى الرسمة بحجمها الصغير معلّقة أعلى الشاشة، وهذا بالضبط
   ما فُتح العارض لعلاجه. */
.viewer__art svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  padding: 10px;
  background: #fff;
  border-radius: 10px;
}
.viewer__art text { font-family: 'Tajawal', system-ui, sans-serif; }

.viewer__hint {
  margin: 0;
  padding: 10px 14px;
  text-align: center;
  font-size: .78rem;
  color: rgba(255, 255, 255, .72);
}

/* ─── إرفاق ملف (PDF / Word) ────────────────────────────── */
.btn-round--doc { background: #eef4ff; color: #2f5fd0; font-size: 1.15rem; }
.btn-round--doc:active { transform: scale(.94); }

.docchip {
  display: none;
  align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 8px;
  background: #eef4ff; border-radius: var(--radius-sm);
}
.docchip.is-on { display: flex; }
.docchip__ico  { font-size: 1.1rem; flex: none; }
.docchip__name {
  flex: 1; min-width: 0;
  font-size: .84rem; font-weight: 700; color: #2f5fd0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.docchip button {
  width: 32px; height: 32px; flex: none;
  font: inherit; color: var(--muted); background: #fff;
  border: 0; border-radius: 10px; cursor: pointer;
}

/* ─── الرسائل الصوتية ───────────────────────────────────── */
.btn-round--mic { background: var(--brand-soft); color: var(--brand); font-size: 1.25rem; }
.btn-round--mic:active { transform: scale(.94); }

/* شريط التسجيل — يحلّ محلّ صندوق الكتابة فلا يشتّت الطفل بخيارين */
.rec {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
}
.rec.is-on { display: flex; }
/* أثناء التسجيل يختفي صندوق الكتابة: خياران معاً يربكان الطفل،
   والإلغاء متاح بـ✕ داخل الشريط نفسه. */
.rec.is-on ~ .composer__box { display: none; }
.rec__dot {
  width: 12px; height: 12px; flex: none;
  background: var(--danger);
  border-radius: 50%;
  animation: recPulse 1.1s ease-in-out infinite;
}
@keyframes recPulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
.rec__time { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.rec__hint { flex: 1; min-width: 0; font-size: .8rem; color: var(--ink-2); }
.rec__cancel, .rec__stop {
  font: inherit; font-weight: 700; border: 0; border-radius: 12px; cursor: pointer;
}
.rec__cancel { width: 36px; height: 36px; flex: none; background: #fff; color: var(--muted); font-size: 1rem; }
.rec__stop   { padding: 10px 16px; background: var(--brand); color: #fff; }

@media (prefers-reduced-motion: reduce) { .rec__dot { animation: none } }

/* تفريغ ما سمعه المعلّم داخل فقاعة الطفل */
.vmsg { display: block; }

/* زرّ الاستماع داخل فقاعة المعلّم */
.speak {
  display: block;
  margin: 8px 0 0 auto;
  width: 38px; height: 38px;
  font-size: 1rem;
  line-height: 1;
  background: var(--brand-soft);
  color: var(--brand);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.speak:active { transform: scale(.94); }
.speak.is-load { opacity: .6; cursor: progress; }

/* ─── صفحة التعريف (الزائر الجديد) ──────────────────────── */
.hero { text-align: center; padding: 8px 0 22px; }
.hero__title {
  font-size: 1.85rem; font-weight: 800; line-height: 1.5;
  margin: 0 0 12px; color: var(--ink);
}
.hero__lead { font-size: 1rem; color: var(--ink-2); line-height: 1.9; margin: 0 0 20px; }
.hero__cta  { width: 100%; max-width: 340px; font-size: 1.05rem; padding: 16px; }
.hero__note { margin: 10px 0 0; font-size: .78rem; color: var(--muted); }

/* المقارنة: الرقم الذي يُقنع ولي الأمر قبل أي كلام عن الميزات */
.compare {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 14px; margin-bottom: 20px;
}
.compare__side  { text-align: center; }
.compare__label { display: block; font-size: .76rem; color: var(--muted); margin-bottom: 4px; }
.compare__price { display: block; font-size: 1.5rem; font-weight: 800; color: var(--ink-2); }
.compare__unit  { display: block; font-size: .7rem; color: var(--muted); margin-top: 2px; }
.compare__vs {
  font-size: .7rem; font-weight: 700; color: var(--muted);
  padding: 6px 8px; background: var(--brand-soft); border-radius: 99px;
}
.compare__side--win .compare__price { color: var(--success); }
.compare__side--win .compare__label { color: var(--brand); font-weight: 700; }

.feats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.feat {
  background: var(--card); border-radius: var(--radius-sm);
  padding: 14px 12px; box-shadow: var(--shadow);
}
.feat span  { font-size: 1.4rem; }
.feat b     { display: block; margin: 6px 0 4px; font-size: .9rem; }
.feat small { display: block; font-size: .74rem; color: var(--ink-2); line-height: 1.7; }

.steps {
  margin: 0 0 26px; padding: 0; list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; font-size: .92rem; color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  flex: none; width: 30px; height: 30px;
  display: grid; place-items: center;
  font-weight: 800; color: #fff; background: var(--brand);
  border-radius: 50%; font-size: .85rem;
}
.steps li:last-child { border-bottom: 0; }
.steps b { color: var(--ink); }

@media (min-width: 620px) {
  .hero__title { font-size: 2.2rem; }
  .feats { grid-template-columns: repeat(4, 1fr); }
}

/* ─── لوحة ولي الأمر ────────────────────────────────────── */
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 0 14px; }
.topbar__title { font-size: 1.25rem; font-weight: 800; margin: 0; }
.topbar__sub   { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }

.gate__icon  { font-size: 2rem; }
.gate__title { font-size: 1.1rem; font-weight: 800; margin: 0; }
.gate__hint  { margin: 0; font-size: .88rem; color: var(--ink-2); line-height: 1.8; }

/* شريط الأسبوع — أول ما تقع عليه عين ولي الأمر */
.wk {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 16px;
}
.wk__cell {
  padding: 16px 10px; text-align: center;
  background: var(--brand); color: #fff;
  border-radius: var(--radius-sm);
}
.wk__cell b    { display: block; font-size: 1.5rem; font-weight: 800; }
.wk__cell span { font-size: .74rem; opacity: .85; }

.kid {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.kid__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.kid__ico  { font-size: 1.9rem; }
.kid__name { margin: 0; font-size: 1.05rem; font-weight: 800; }
.kid__meta { margin: 2px 0 0; font-size: .78rem; color: var(--muted); }

.kid__nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.kid__nums div  { text-align: center; padding: 10px 4px; background: var(--brand-soft); border-radius: 12px; }
.kid__nums b    { display: block; font-size: 1.15rem; font-weight: 800; color: var(--brand); }
.kid__nums span { font-size: .68rem; color: var(--ink-2); }

.block { margin-bottom: 14px; }
.block h4 { margin: 0 0 8px; font-size: .82rem; font-weight: 700; color: var(--ink-2); }

.sub { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: .82rem; }
.sub__name { width: 74px; flex: none; }
.sub__bar  { flex: 1; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.sub__bar i { display: block; height: 100%; background: var(--brand); }
.sub__n { width: 26px; text-align: left; color: var(--muted); }

.chipsrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 5px 10px; font-size: .76rem; font-weight: 600;
  background: var(--brand-soft); color: var(--ink); border-radius: 99px;
}
.tag--warn { background: #fff4e0; color: #9a5b00; }
.tag--warn b { color: #c47500; }

.trend { margin: 0; font-weight: 700; font-size: .9rem; }
.trend small { font-weight: 400; color: var(--muted); margin-inline-start: 6px; }
.trend--up   { color: var(--success); }
.trend--down { color: var(--danger); }
.trend--flat { color: var(--ink-2); }

.pill--fire {
  flex: none; padding: 6px 10px; font-size: .74rem; font-weight: 700;
  background: #fff1e6; color: #b34700; border-radius: 99px;
}

.kid__acts { display: flex; gap: 8px; flex-wrap: wrap; }
.kid__acts .btn { flex: 1; min-width: 140px; }

/* التقرير الأسبوعي — مصمَّم ليُصوَّر ويُشارَك كما هو */
.rep {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 14px 0;
  border-top: 5px solid var(--brand);
}
.rep__head   { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.rep__ico    { font-size: 2rem; }
.rep__name   { margin: 0; font-size: 1.15rem; font-weight: 800; }
.rep__period { margin: 2px 0 0; font-size: .76rem; color: var(--muted); }

.rep__nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.rep__nums div  { text-align: center; padding: 12px 4px; background: var(--brand-soft); border-radius: 12px; }
.rep__nums b    { display: block; font-size: 1.3rem; font-weight: 800; color: var(--brand); }
.rep__nums span { font-size: .7rem; color: var(--ink-2); }

.rep__text {
  margin: 0 0 14px; font-size: .92rem; line-height: 2;
  color: var(--ink); white-space: pre-line;
}
.rep__brand {
  margin: 16px 0 0; padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: center; font-size: .72rem; color: var(--muted); font-weight: 700;
}
.rep__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.rep__actions .btn { flex: 1; min-width: 150px; }

/* قراءة المحادثات */
.talks__who  { margin: 12px 0; }
.talks__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tab {
  padding: 8px 14px; font: inherit; font-size: .82rem; font-weight: 700;
  background: #fff; color: var(--ink-2);
  border: 1.5px solid var(--line); border-radius: 99px; cursor: pointer;
}
.tab.is-on { background: var(--brand); color: #fff; border-color: var(--brand); }
.tab span  { opacity: .7; font-weight: 400; }

.talks__more { display: flex; justify-content: center; margin-bottom: 12px; }
.talks__more button {
  padding: 8px 16px; font: inherit; font-size: .8rem; font-weight: 700;
  color: var(--brand); background: #fff;
  border: 1.5px solid var(--line); border-radius: 99px; cursor: pointer;
}

.talk { margin-bottom: 12px; padding: 12px 14px; border-radius: var(--radius-sm); }
.talk--kid { background: var(--brand-soft); }
.talk--bot { background: #fff; border: 1.5px solid var(--line); }
.talk__who { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.talk__who i { font-style: normal; opacity: .7; margin-inline-start: 6px; }
.talk p { margin: 0; font-size: .88rem; line-height: 1.9; }

/* ─── المحادثة الصوتية الحيّة ───────────────────────────── */
.btn-round--call { background: #e8f7ee; color: var(--success); font-size: 1.2rem; }
.btn-round--call:active { transform: scale(.94); }

.live {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  flex-direction: column;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
  background: linear-gradient(160deg, #2a2d63, #12142f);
  color: #fff;
}
.live.is-on { display: flex; }

.live__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 2px; font-size: .85rem;
}
.live__time { font-weight: 800; font-variant-numeric: tabular-nums; }
.live__left { color: rgba(255,255,255,.65); }

.live__stage { display: grid; place-items: center; gap: 14px; padding: 18px 0 10px; }

.live__orb {
  width: 132px; height: 132px;
  display: grid; place-items: center;
  font-size: 3rem;
  background: rgba(255,255,255,.10);
  border: 2px solid rgba(255,255,255,.22);
  border-radius: 50%;
}
/* النبض يميّز «المعلّم يتكلّم» عن «دورك» بلا قراءة نصّ */
.live__orb.is-speaking { animation: orbPulse 1.4s ease-in-out infinite; }
@keyframes orbPulse {
  0%,100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(255,255,255,.28) }
  50%     { transform: scale(1.06); box-shadow: 0 0 0 22px rgba(255,255,255,0) }
}
@media (prefers-reduced-motion: reduce) { .live__orb.is-speaking { animation: none } }

.live__state { font-size: 1rem; font-weight: 700; }

/* التفريغ الحيّ: الطفل يقرأ ما فهمه المعلّم منه فيصحّح نطقه بنفسه */
.live__script {
  flex: 1; min-height: 0; overflow-y: auto;
  margin: 10px 0;
  padding: 12px;
  background: rgba(0,0,0,.22);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  line-height: 1.9;
}
.live__line { margin-bottom: 8px; color: rgba(255,255,255,.9); }
.live__line b { color: var(--accent); margin-inline-end: 6px; }
.live__line.is-me b { color: #9ad7ff; }

.live__nudge {
  display: none;
  align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 10px;
  background: rgba(255,176,32,.16);
  border: 1.5px solid rgba(255,176,32,.5);
  border-radius: var(--radius-sm);
  font-size: .85rem;
}
.live__nudge.is-on { display: flex; }
.live__nudge button {
  margin-inline-start: auto;
  padding: 8px 14px;
  font: inherit; font-weight: 700;
  background: var(--accent); color: #2a2d63;
  border: 0; border-radius: 10px; cursor: pointer;
}

.live__end {
  width: 100%;
  padding: 16px;
  margin-bottom: 10px;
  font: inherit; font-size: 1rem; font-weight: 800;
  color: #fff; background: var(--danger);
  border: 0; border-radius: var(--radius-sm);
  cursor: pointer;
}
.live__end:active { transform: scale(.99); }

/* ─── زرّ الرسائل الأقدم ────────────────────────────────── */
.older { display: flex; justify-content: center; padding: 4px 0 10px; }
.older button {
  padding: 8px 16px;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  color: var(--brand);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.older button:disabled { opacity: .6; cursor: default; }

/* الميزة الغائبة في بطاقة الباقة الأدنى — تُرى الفروق بلا قراءة جدول */
.plan__feats li.is-off { color: var(--muted); text-decoration: none; opacity: .75; }
.plan__feats li.is-off b { color: var(--muted); font-weight: 600; }

/* ═══ زرّ الإرفاق المدمج ═══════════════════════════════════
   خمسة أزرار مستديرة (٤٨px × ٥) كانت تترك للكتابة أقلّ من نصف
   عرض الشاشة على هاتف ٣٩٠px. الآن: إرفاق + ميكروفون + إرسال،
   والمقاس ٤٢px بدل ٤٨ — أي ~٩٠px إضافية للنصّ. */
.btn-round { width: 42px; height: 42px; font-size: 1.15rem; }
.composer__box { gap: 6px; padding: 7px 9px; }

.attach { position: relative; flex: none; }
.btn-round--attach {
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 1.35rem; line-height: 1;
}
.btn-round--attach[aria-expanded="true"] { background: var(--brand); color: #fff; }

/* القائمة تفتح **فوق** الزرّ: أسفلها لوحة المفاتيح على الهاتف */
.attach__menu {
  display: none;
  position: absolute; bottom: calc(100% + 8px); inset-inline-start: 0;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 6px; min-width: 190px; z-index: 40;
}
.attach__menu.is-on { display: block; }
.attach__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 12px;
  background: none; border: none; border-radius: 10px;
  font: inherit; font-size: .95rem; font-weight: 600; color: var(--ink);
  cursor: pointer; text-align: start;
}
.attach__item:hover, .attach__item:focus-visible { background: var(--brand-soft); }
.attach__item[hidden] { display: none; }
.attach__item span { font-size: 1.15rem; }

/* ─── اختيار باقة الطفل (شاشة إضافة طفل) ─────────────────── */
/* أزرارٌ لا <select>: السعر والمزايا يجب أن يُقرآ قبل الاختيار لا بعده */
.planpick { display: grid; gap: 8px; }
.planpick__btn {
  display: block; width: 100%; text-align: start;
  border: 1.5px solid var(--line); border-radius: 13px;
  background: #fbfbff; color: var(--ink);
  font: inherit; padding: 11px 12px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.planpick__btn.is-on { border-color: var(--brand); background: #fff; box-shadow: var(--shadow); }
.planpick__top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.planpick__price { font-weight: 700; color: var(--brand-dark); white-space: nowrap; }
.planpick__meta { display: block; margin-top: 3px; font-size: .82rem; color: var(--ink-2); }

/* ─── السعر مشطوباً بجانب «مجاني» أثناء المهلة التجريبية ─── */
/* الشطب من النمط لا من محرف: قارئ الشاشة يقرأ الرقم كما هو، ويبقى
   واضحاً أن السعر الحقيقي موجود لكنه غير مطلوب الآن. */
.price-was  { color: var(--ink-2); font-weight: 600; text-decoration: line-through; opacity: .75; }
.price-free { color: #15803d; font-weight: 800; }

/* ─── وحدات الطفل في شاشة ولي الأمر ──────────────────────── */
/* لكل طفلٍ شريطُه: الرقم المجمّع للأسرة لا يقول أيّ الأبناء استهلك */
.kid__units { margin: 10px 0 14px; }
.kid__units-top {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: .82rem; color: var(--ink-2); margin-bottom: 6px;
}
.bar { height: 8px; border-radius: 999px; background: #eef0f8; overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.bar__fill.is-warm { background: var(--accent); }
.bar__fill.is-hot  { background: var(--danger); }

/* ═══════════════════════════════════════════════════════════════
   الشاشات الكبيرة — الآيباد (عمودي ٨٢٠ وأفقي ١١٨٠) واللابتوب
   (٢٠٢٦-١٠-٠٧)

   ⚠️ كل ما هنا داخل ‎@media (min-width)‎ عمداً: الهاتف (حتى ~٦٠٠px)
   لا يتغيّر فيه بكسل واحد — وهذا مقيس بمقارنة صور قبل/بعد على ٣٩٠px.

   تخطيط كل صفحة يُعرَّف بما فيها (‎:has‎) لا بصنف جديد في HTML،
   فلا يُمسّ هيكل الصفحات. المتصفّح الذي لا يعرف ‎:has‎ (آيباد أقدم
   من iPadOS 15.4) يرى التخطيط السابق كما هو — لا شيء ينكسر.
   ═══════════════════════════════════════════════════════════════ */

/* ─── من الآيباد العمودي فما فوق ───────────────────────────── */
@media (min-width: 700px) {
  /* البطاقات والنماذج الضيّقة كانت ملتصقة باليمين وبجانبها فراغ —
     تتوسّط الآن */
  .panel, .pay-card { margin-inline: auto; width: 100%; }
  .pay-card { max-width: 520px; }

  /* الدخول/التسجيل وحده (بلا صفحة التعريف): عمود واحد متوسّط */
  #familyPane { width: 100%; max-width: 560px; margin-inline: auto; }
  #familyPane > h1, #familyPane > .lead { text-align: center; }
  #authTabs { margin-inline: auto; max-width: none; }
  #familyPane .panel { max-width: none; }

  /* المواد: عمودان بدل قائمة طويلة */
  .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* لوحة ولي الأمر: حاجز كلمة المرور في الوسط */
  #gate { max-width: 460px; }

  /* الاشتراك: رصيد الوحدات بعرض الصفحة لا بعرض نموذج */
  #usageBox .panel { max-width: none; }

  /* تأكيد الرقم: بطاقة الرمز أوسع قليلاً لتقرأ تعليماتها في أسطر أقل */
  #askBox .pay-card { max-width: 600px; }
}

/* ─── الآيباد الأفقي واللابتوب ─────────────────────────────── */
@media (min-width: 1024px) {
  .shell { padding: 30px 32px 44px; }

  /* ═══ الصفحة الرئيسية للزائر: التعريف يميناً والدخول يساراً ═══
     بدل عمود ضيّق طويل يضطر الزائر للتمرير حتى يجد نموذج الدخول */
  .shell:has(> #landing:not([hidden])) {
    max-width: 1160px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    column-gap: 48px;
    align-content: start;
  }
  .shell:has(> #landing:not([hidden])) > .brand,
  .shell:has(> #landing:not([hidden])) > .foot { grid-column: 1 / -1; }
  .shell:has(> #landing:not([hidden])) > #familyPane {
    max-width: none; margin: 0; align-self: start;
    background: rgba(255, 255, 255, .55);
    border-radius: var(--radius);
    padding: 22px 22px 26px;
  }
  .shell:has(> #landing:not([hidden])) > #familyPane > h1,
  .shell:has(> #landing:not([hidden])) > #familyPane > .lead { text-align: right; }
  .shell:has(> #landing:not([hidden])) #regPlans { grid-template-columns: 1fr; }
  .shell:has(> #landing:not([hidden])) .hero { padding-top: 24px; }
  .shell:has(> #landing:not([hidden])) .feats { grid-template-columns: repeat(2, 1fr); }

  /* ═══ بطاقات الأطفال: الأطفال في المتن، والرصيد في عمود جانبي ═══ */
  .shell:has(> #childPane:not([hidden])) { max-width: 1120px; }
  #childPane {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    column-gap: 28px;
    grid-auto-flow: row dense;
    align-items: start;
  }
  #childPane > .greet,
  #childPane > .notice,
  #childPane > #pendingBox { grid-column: 1 / -1; }
  #childPane > #unitsBox { grid-column: 2; grid-row: span 2; }
  #childPane > #grid,
  #childPane > #grid ~ div { grid-column: 1; }
  #childPane:has(> #unitsBox[hidden]) > #grid,
  #childPane:has(> #unitsBox[hidden]) > #grid ~ div { grid-column: 1 / -1; }
  #childPane > #grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

  /* ═══ المواد: ثلاثة أعمدة ═══ */
  .shell:has(#subjects) { max-width: 1080px; }
  .subject-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* ═══ المحادثة: عرض مريح للقراءة، والفقاعة لا تمتدّ على السطر كلّه ═══ */
  .chat-page { max-width: 920px; }
  .msg { max-width: 78%; }
  .bubble img { max-width: 300px; }
  .draw__svg { max-height: 460px; }

  /* ═══ لوحة ولي الأمر: بطاقات الأبناء في عمودين ═══ */
  .shell:has(> #overview) { max-width: 1120px; }
  #kids {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: 18px;
    align-items: start;
  }
  #kids > .kid { margin-bottom: 0; }
  /* ثلاثة أزرار في سطر واحد داخل البطاقة الأضيق — بلا التفاف للنصّ */
  #kids .kid__acts .btn { min-width: 0; padding: 0 12px; font-size: .95rem; white-space: nowrap; }
  /* التقرير والمحادثات والتعديل نصٌّ يُقرأ: عرض قراءة مريح في الوسط */
  #report, #talks, #editPane { width: 100%; max-width: 760px; margin-inline: auto; }
  #editPane .panel { max-width: none; }

  /* ═══ الاشتراك: الباقات في المتن، والفاتورة وما يتبعها في عمود جانبي ═══
     ‎span 12‎ للباقات يسمح للعمود الجانبي أن يتراصّ تحت بعضه بلا
     فجوات مهما كان ارتفاع الباقات. */
  .shell:has(> #billBox) {
    max-width: 1140px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    column-gap: 30px;
    grid-auto-flow: row dense;
    align-content: start;
    align-items: start;
  }
  .shell:has(> #billBox) > .greet,
  .shell:has(> #billBox) > #stateBox,
  .shell:has(> #billBox) > .foot { grid-column: 1 / -1; }
  .shell:has(> #billBox) > #plansBox { grid-column: 1; grid-row: span 12; }
  .shell:has(> #billBox) > #plansBox .section-title { margin-top: 0; }
  .shell:has(> #billBox) > #upgradeBox,
  .shell:has(> #billBox) > #billBox,
  .shell:has(> #billBox) > #cardsBox,
  .shell:has(> #billBox) > #autoBox,
  .shell:has(> #billBox) > #usageBox,
  .shell:has(> #billBox) > #logBox { grid-column: 2; }
  .shell:has(> #billBox) > #upgradeBox { margin-bottom: 18px; }
  .shell:has(> #billBox) .pay-card { max-width: none; }
  .shell:has(> #billBox) .saved-card .btn { padding: 0 12px; }

  /* ═══ إضافة طفل: النموذج في عمودين ═══ */
  .shell:has(> #step2) { max-width: 960px; }
  #childForm.panel {
    max-width: 820px;
    grid-template-columns: 1fr 1fr;
    column-gap: 22px;
    grid-auto-flow: row dense;      /* الصف والأيقونة/المنهج في سطر واحد */
  }
  #childForm > div:has(#planPick),
  #childForm > button { grid-column: 1 / -1; }
  #childForm .planpick { grid-template-columns: 1fr 1fr; }

  /* ═══ تأكيد الرقم: التعليمات يميناً وبطاقة الرمز يساراً ═══ */
  .shell:has(> #askBox) { max-width: 1120px; }
  #askBox {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 460px;
    column-gap: 28px;
    align-items: start;
  }
  #askBox > .notice { grid-column: 1; }
  #askBox > .pay-card { grid-column: 2; grid-row: 1 / span 12; max-width: none; }
}

/* ═══════════════════════════════════════════════════════════════
   الواجهة الإنجليزية (LTR) — تصحيحات فوق القواعد أعلاه لا بدلاً منها
   ما أعلاه مكتوب للعربية (RTL)، وهذه تسري فقط حين <html dir="ltr">،
   فلا تمسّ الواجهة العربية شيئاً.
   ═══════════════════════════════════════════════════════════════ */
[dir=ltr] .pay-feats,
[dir=ltr] .subject-card,
[dir=ltr] .saved-card__num { text-align: left; }
[dir=ltr] .sub__n { text-align: right; }
[dir=ltr] .sub__name { width: 96px; }
[dir=ltr] .subject-card:hover,
[dir=ltr] .subject-card:focus-visible { transform: translateX(5px); }
/* سهم الإرسال ➤ يتّجه يميناً أصلاً في LTR — لا قلب */
[dir=ltr] .btn-round--send .ico { transform: none; }
/* ذيل الفقاعة في الزاوية المجاورة للصورة الرمزية */
[dir=ltr] .msg--bot .bubble { border-radius: 20px 20px 20px 6px; }
[dir=ltr] .msg--me .bubble  { border-radius: 20px 20px 6px 20px; }
/* رسائل قديمة أو محتوى عربي (محادثات، تقرير، وسوم) داخل واجهة إنجليزية:
   كل فقرة تأخذ اتجاه لغتها هي، فلا تنقلب علامات الترقيم والأرقام */
[dir=ltr] .bubble, [dir=ltr] .talk p, [dir=ltr] .rep__text, [dir=ltr] .quote,
[dir=ltr] .reply-bar__txt { unicode-bidi: plaintext; text-align: start; }
/* محاذاة مكتوبة داخل الصفحات (style="text-align:right") */
[dir=ltr] [style*="text-align:right"] { text-align: left !important; }
[dir=ltr] .shell:has(> #landing:not([hidden])) > #familyPane > h1,
[dir=ltr] .shell:has(> #landing:not([hidden])) > #familyPane > .lead { text-align: left; }

/* زرّ تبديل اللغة «English / العربية» */
.lang-btn {
  flex: none;
  border: 1.5px solid var(--line); background: var(--card);
  color: var(--brand-dark); font: inherit; font-size: .85rem; font-weight: 700;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  white-space: nowrap; line-height: 1.4; min-height: 36px;
}
.lang-btn:hover { background: var(--brand-soft); }
.lang-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.brand .lang-btn { margin-inline-start: auto; }
.lang-btn--sm { padding: 4px 10px; font-size: .78rem; min-height: 32px; }
.foot .lang-btn { margin-top: 10px; }

/* ═══════════════════════════════════════════════════════════════
   الصفحة الرئيسية مضغوطة + زرّ «حمّل التطبيق» (٢٠٢٦-١٠-٢٣)
   طلب المالك: يصل الزائر إلى المحتوى بلا تمرير طويل.
   ⚠️ أحجام ومسافات فقط — لا نصّ ولا سعر ولا رابط تغيّر.
   كل القواعد مقيّدة بعناصر الصفحة الرئيسية وحدها (#landing و#familyPane
   و#regPlans)، فبطاقات الباقات في صفحة الاشتراك لا تتأثّر.
   ═══════════════════════════════════════════════════════════════ */

/* ─── زرّ «حمّل التطبيق» → صفحة التحميل app/ ─────────────────── */
.dl-app {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; max-width: 340px; min-height: 46px; margin-top: 12px;
  padding: 0 18px; border-radius: 14px;
  background: var(--brand-soft); color: var(--brand-dark);
  border: 1.5px solid #d9d9f7;
  font: inherit; font-size: .98rem; font-weight: 700; text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.dl-app:hover { background: #e3e3fb; border-color: var(--brand); box-shadow: 0 6px 16px rgba(91, 92, 228, .16); }
.dl-app:active { transform: translateY(1px); }
.dl-app:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* النسخة الصغيرة بين أزرار ولي الأمر — شكل الأزرار المجاورة نفسه */
.dl-app--sm {
  width: auto; max-width: none; margin-top: 0;
  min-height: var(--tap); padding: 0 26px; border-radius: 16px;
  background: transparent; color: var(--ink-2); border-color: var(--line);
  font-size: 1.05rem;
}
.dl-app--sm:hover { background: var(--brand-soft); color: var(--brand-dark); box-shadow: none; }
/* داخل التطبيق المثبَّت لا معنى لـ«حمّل التطبيق» */
html.is-app .dl-app { display: none !important; }
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
  .dl-app { display: none !important; }
}

/* ─── الترويسة في الصفحة الرئيسية ─────────────────────────────── */
.shell:has(> #landing) > .brand { margin-bottom: 12px; gap: 10px; }
.shell:has(> #landing) > .brand .brand__logo { width: 42px; height: 42px; font-size: 21px; border-radius: 13px; }
.shell:has(> #landing) > .brand .brand__name { font-size: 1.15rem; line-height: 1.5; }
.shell:has(> #landing) > .brand .brand__sub  { font-size: .74rem; line-height: 1.5; margin-top: -2px; }

/* ─── التعريف بالمنتج ─────────────────────────────────────────── */
#landing .hero { padding: 4px 0 14px; }
#landing .hero__title { font-size: 1.45rem; line-height: 1.45; margin: 0 0 8px; }
#landing .hero__lead { font-size: .92rem; line-height: 1.7; margin: 0 0 14px; }
#landing .hero__cta { min-height: 50px; padding: 0 16px; font-size: 1rem; }
#landing .hero__note { margin-top: 6px; font-size: .74rem; line-height: 1.5; }

#landing .compare { padding: 10px 12px; margin-bottom: 12px; gap: 8px; }
#landing .compare__label { margin-bottom: 0; font-size: .72rem; }
#landing .compare__price { font-size: 1.2rem; line-height: 1.5; }
#landing .compare__unit  { margin-top: 0; font-size: .68rem; line-height: 1.5; }
#landing .compare__vs    { padding: 4px 8px; }

/* الميزات: الأيقونة بجانب النصّ لا فوقه — يوفّر سطراً في كل بطاقة */
#landing .feats { gap: 8px; margin-bottom: 12px; }
#landing .feat {
  padding: 10px; display: grid; grid-template-columns: auto 1fr;
  column-gap: 8px; align-items: start;
}
#landing .feat span  { font-size: 1.1rem; line-height: 1.4; grid-row: span 2; }
#landing .feat b     { margin: 0 0 2px; font-size: .86rem; line-height: 1.5; }
#landing .feat small { font-size: .72rem; line-height: 1.55; }

#landing .steps { margin-bottom: 14px; }
#landing .steps li { padding: 7px 0; gap: 10px; font-size: .88rem; line-height: 1.6; }
#landing .steps li::before { width: 26px; height: 26px; font-size: .8rem; }

/* ─── الدخول / الاشتراك الجديد ────────────────────────────────── */
#familyPane > h1 { font-size: 1.35rem; margin-bottom: 2px; }
#familyPane > .lead { font-size: .92rem; margin-bottom: 14px; }
#familyPane .tabs { margin-bottom: 12px; }
#familyPane .tabs__btn { padding: 8px; }
#familyPane .panel { padding: 18px 16px; gap: 12px; }
#familyPane .panel input { padding: 11px 13px; min-height: 48px; font-size: 1rem; }
#familyPane .panel label { margin-bottom: 4px; }
#regUnitsNote { font-size: .74rem; line-height: 1.6; }

/* ─── بطاقات الباقات في «اشتراك جديد» — أصغر ─────────────────── */
#regPlans .plan { padding: 14px 12px 12px; border-radius: 18px; }
#regPlans .plan:hover, #regPlans .plan:focus-visible { transform: none; }
#regPlans .plan__flag { top: -10px; font-size: .68rem; padding: 2px 10px; }
#regPlans .plan__name  { margin: 2px 0 0; font-size: 1.05rem; line-height: 1.5; }
#regPlans .plan__tag   { margin: 0 0 8px; font-size: .76rem; line-height: 1.55; min-height: 0; }
#regPlans .plan__price b    { font-size: 1.5rem; line-height: 1.3; }
#regPlans .plan__price span { font-size: .78rem; }
#regPlans .plan__extra, #regPlans .plan__window { font-size: .74rem; line-height: 1.55; }
#regPlans .plan__save { font-size: .74rem; margin-top: 4px; }
#regPlans .plan__feats { margin: 10px 0 12px; gap: 4px; }
#regPlans .plan__feats li { font-size: .8rem; line-height: 1.55; gap: 6px; }
#regPlans .plan__feats li span { font-size: .85rem; }
#regPlans .plan__feats li i { font-size: .72rem; }
#regPlans .plan__pick { min-height: 40px; font-size: .88rem; border-radius: 12px; }
#familyPane .period-btn { padding: 6px 12px; }

/* الهاتف: الباقات صفّاً أفقياً يُسحب بالإصبع، وطرف الثانية ظاهر ليُعرف أن
   هناك المزيد. الحاشية العلوية مكان شارة «اختيارك» التي تبرز فوق البطاقة. */
@media (max-width: 639px) {
  #regPlans {
    grid-auto-flow: column; grid-auto-columns: 82%;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: 2px;
    padding: 12px 2px 6px; margin-inline: -2px;
    gap: 10px; align-items: start; scrollbar-width: thin;
  }
  #regPlans > .plan { scroll-snap-align: start; box-shadow: 0 6px 16px rgba(27, 33, 64, .07); }
}

@media (min-width: 620px) {
  #landing .hero__title { font-size: 1.85rem; }
}
@media (min-width: 1024px) {
  .shell:has(> #landing:not([hidden])) .hero { padding-top: 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   مسار التسجيل المختصر (٢٠٢٦-١٠-٣٠)
   النموذج تحت البطل مباشرة، والمقارنة والمزايا والأسعار بعده في
   #landingMore — فتُنقل لها قواعد الضغط التي كانت على #landing.
   ═══════════════════════════════════════════════════════════════ */
.reg-free { margin: 0; text-align: center; font-size: .9rem; line-height: 1.6; color: var(--ink-2); }
.reg-free b { color: var(--success); }

#landingMore { margin-top: 22px; }
#landingMore .compare { padding: 10px 12px; margin-bottom: 12px; gap: 8px; }
#landingMore .compare__label { margin-bottom: 0; font-size: .72rem; }
#landingMore .compare__price { font-size: 1.2rem; line-height: 1.5; }
#landingMore .compare__unit  { margin-top: 0; font-size: .68rem; line-height: 1.5; }
#landingMore .compare__vs    { padding: 4px 8px; }
#landingMore .feats { gap: 8px; margin-bottom: 12px; }
#landingMore .feat span  { font-size: 1.1rem; line-height: 1.4; grid-row: span 2; }
#landingMore .feat b     { margin: 0 0 2px; font-size: .86rem; line-height: 1.5; }
#landingMore .feat small { font-size: .72rem; line-height: 1.55; }
#landingMore .steps { margin-bottom: 14px; }
#landingMore .steps li { padding: 7px 0; gap: 10px; font-size: .88rem; line-height: 1.6; }
#landingMore .steps li::before { width: 26px; height: 26px; font-size: .8rem; }

/* الأسعار: عرضٌ لا اختيار — لا زرّ «اختيار هذه الباقة» */
.prices { margin-top: 8px; }
.prices__title { margin: 0 0 2px; font-size: 1.1rem; }
#prices .plan__pick { display: none; }
#prices .plan { cursor: default; }

/* على الهاتف: البطل أقصر قليلاً فيظهر أول حقل في الشاشة الأولى */
@media (max-width: 639px) {
  #landing .hero { padding-bottom: 6px; }
  #landing .hero__cta { display: none; }        /* النموذج نفسه تحته مباشرة */
  #landing .hero__note { display: none; }
  #landing .dl-app { margin-top: 6px; }
  .shell:has(> #landing:not([hidden])) #familyPane > h1 { display: none; }
  .shell:has(> #landing:not([hidden])) #familyPane > .lead { margin-bottom: 10px; }
  #prices #regPlans {
    grid-auto-flow: column; grid-auto-columns: 82%;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; padding: 12px 2px 6px; gap: 10px; align-items: start;
  }
}

/* الحاسوب: النموذج يميناً بطول عمودين، والتعريف والأسعار يساراً */
@media (min-width: 1024px) {
  .shell:has(> #landing:not([hidden])) > #familyPane { grid-row: span 2; }
  .shell:has(> #landing:not([hidden])) > #landingMore { grid-column: 1; margin-top: 0; }
  .shell:has(> #landing:not([hidden])) #landingMore .feats { grid-template-columns: repeat(2, 1fr); }
  .shell:has(> #landing:not([hidden])) #landingMore #regPlans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── «سؤال تجريبي» داخل المحادثة لمن لم يسأل بعد — تلميحٌ هادئ ─── */
.try-hint {
  margin: 2px 6px 0; font-size: .8rem; line-height: 1.7; color: var(--muted);
}
.try-hint button {
  background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2);
  text-align: start; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 3px;
}

/* ─── شريط «أكّد رقمك» أثناء التجربة — تذكيرٌ لا حاجز ─────────── */
.nudge {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px; padding: 8px 12px;
  background: #fff7e6; border: 1px solid #ffd27a; border-radius: 12px;
  font-size: .82rem; line-height: 1.5;
}
.nudge__txt { flex: 1; color: var(--ink); text-decoration: none; }
.nudge__txt b { color: var(--brand-dark); white-space: nowrap; }
.nudge__x { background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; padding: 4px 6px; }
