/* ==========================================================================
   خِبرة — «اكتشف»: تصفّح عمودي غامر بأسلوب تيك توك
   ========================================================================== */
body.discover { margin: 0; background: #0A0A0B; color: #fff; overflow: hidden; padding-bottom: 0 !important; }
.discover .tabbar { max-width: none; inset-inline: 0; bottom: 0; border-radius: 0; box-shadow: none; border-width: 1px 0 0;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
:root { --dtab: calc(64px + env(safe-area-inset-bottom, 0px)); }

/* الترويسة العائمة */
.dtop { position: fixed; top: 0; inset-inline: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 22px;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent); pointer-events: none; }
.dtop > * { pointer-events: auto; }
.dtop__brand img { height: 26px; width: auto; display: block; }
.dtop__title { margin: 0; color: #fff; font-family: var(--font-display); font-size: 16px; font-weight: 800; letter-spacing: .01em;
  text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.dtop__sound { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff;
  display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.dtop__sound svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dtop__sound .i-on { display: none; } .dtop__sound[aria-pressed="true"] .i-on { display: block; } .dtop__sound[aria-pressed="true"] .i-off { display: none; }

/* الخلاصة */
.feed { height: calc(100dvh - var(--dtab)); overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.feed::-webkit-scrollbar { display: none; }
.reel { position: relative; height: calc(100dvh - var(--dtab)); scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: #000; }
.reel__stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; max-width: 560px; margin-inline: auto; }
.reel__media { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.reel[data-kind="video"] .reel__media { cursor: pointer; }
.reel__paused { position: absolute; width: 74px; height: 74px; border-radius: 50%; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .2s;
  pointer-events: none; }
.reel__paused::after { content: ""; position: absolute; inset-inline-start: 29px; top: 22px; border-style: solid; border-width: 15px 0 15px 24px;
  border-color: transparent transparent transparent #fff; }
[dir="rtl"] .reel__paused::after { transform: scaleX(-1); inset-inline-start: auto; inset-inline-end: 21px; }
.reel.is-paused .reel__paused { opacity: 1; }
/* تدرّج لقراءة النص */
.reel::after { content: ""; position: absolute; inset: auto 0 0; height: 46%; background: linear-gradient(to top, rgba(0,0,0,.75), transparent);
  pointer-events: none; }

/* عمود الأزرار — في الطرف المقابل لبداية السطر كما في تيك توك المعرَّب */
.reel__side { position: absolute; z-index: 3; inset-inline-end: 10px; bottom: 150px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.reel__who { position: relative; display: block; margin-bottom: 6px; }
.reel__av { width: 50px; height: 50px; font-size: 16px; border: 2px solid #fff; box-shadow: none; }
.reel__who b { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold); color: #fff; font-size: 15px; line-height: 19px; text-align: center; font-weight: 700; }
.reel__btn { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; color: #fff; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; padding: 0; text-shadow: 0 1px 6px rgba(0,0,0,.5); -webkit-tap-highlight-color: transparent; }
.reel__btn svg { width: 34px; height: 34px; fill: rgba(255,255,255,.12); stroke: #fff; stroke-width: 1.6; stroke-linejoin: round;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.4)); transition: transform .18s; }
.reel__btn:active svg { transform: scale(.88); }
.js-like.on svg { fill: #FE2C55; stroke: #FE2C55; animation: pop .35s ease; }
.reel__views { cursor: default; opacity: .85; }
.reel__views svg { width: 28px; height: 28px; fill: none; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* معلومات المنشور */
.reel__info { position: absolute; z-index: 3; inset-inline-start: 14px; inset-inline-end: 84px; bottom: 18px; }
.reel__name { display: block; color: #fff; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 16px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.reel__name small { font-family: inherit; font-weight: 500; font-size: 12.5px; opacity: .8; }
.reel__ok { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #20D5EC; color: #fff;
  font-size: 10px; vertical-align: 2px; }
.reel__cap { margin: 8px 0 0; font-size: 14px; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; cursor: pointer; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.reel__cap.open { -webkit-line-clamp: unset; max-height: 40dvh; overflow-y: auto; }
.reel__cta { display: inline-flex; align-items: center; margin-top: 12px; padding: 9px 18px; border-radius: 999px; background: var(--gold);
  color: #fff; font-size: 13.5px; font-weight: 700; text-decoration: none; }

.feed__empty { height: calc(100dvh - var(--dtab)); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; gap: 6px; scroll-snap-align: start; }
.feed__empty svg { width: 56px; height: 56px; stroke: var(--gold); fill: none; stroke-width: 1.5; margin-bottom: 8px; }
.feed__empty h2 { margin: 0; font-family: var(--font-display); font-size: 20px; }
.feed__empty p { margin: 0; max-width: 320px; color: rgba(255,255,255,.7); line-height: 1.8; font-size: 14.5px; }
.feed__more { height: 1px; }

.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--dtab) + 18px); transform: translateX(-50%); background: rgba(255,255,255,.95);
  color: #111; padding: 9px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .js-like.on svg { animation: none; } .feed { scroll-behavior: auto; } }
.dtop__end { display: flex; gap: 8px; }
a.dtop__sound { text-decoration: none; }
.dtop__sound svg circle { fill: none; }

/* قلب النقرتين */
.reel__stage { -webkit-user-select: none; user-select: none; }
.heart-burst { position: absolute; z-index: 5; width: 96px; height: 96px; margin: -48px 0 0 -48px; pointer-events: none;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23FE2C55' d='M12 20.5s-7.5-4.6-9.3-9.4C1.4 7.6 3.6 4 7.2 4c2 0 3.6 1.1 4.8 2.8C13.2 5.1 14.8 4 16.8 4c3.6 0 5.8 3.6 4.5 7.1-1.8 4.8-9.3 9.4-9.3 9.4z'/%3E%3C/svg%3E");
  filter: drop-shadow(0 4px 14px rgba(254,44,85,.45)); animation: burst .85s ease forwards; transform: rotate(var(--rot, 0deg)); }
@keyframes burst { 0% { opacity: 0; transform: rotate(var(--rot)) scale(.3); } 15% { opacity: 1; transform: rotate(var(--rot)) scale(1.15); }
  30% { transform: rotate(var(--rot)) scale(.95); } 70% { opacity: 1; transform: rotate(var(--rot)) scale(1) translateY(-10px); }
  100% { opacity: 0; transform: rotate(var(--rot)) scale(1.4) translateY(-60px); } }
@media (prefers-reduced-motion: reduce) { .heart-burst { animation-duration: .4s; } }

/* لوحة التعليقات من الأسفل */
.sheet { position: fixed; inset: 0; z-index: 100; }
.sheet__bg { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.sheet__panel { position: absolute; inset-inline: 0; bottom: 0; max-width: 640px; margin-inline: auto; height: 68dvh; display: flex; flex-direction: column;
  background: #121212; color: #fff; border-radius: 18px 18px 0 0; animation: sheetUp .26s ease; padding-bottom: env(safe-area-inset-bottom, 0px); }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet__head { display: flex; align-items: center; justify-content: center; position: relative; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sheet__head h2 { margin: 0; color: #fff; font-size: 14px; font-weight: 700; font-family: inherit; }
.sheet__x { position: absolute; inset-inline-end: 12px; top: 8px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 16px; cursor: pointer; }
.cm-list { list-style: none; margin: 0; padding: 8px 16px; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.cm-list:empty::before { content: attr(data-empty); display: block; text-align: center; color: rgba(255,255,255,.55); padding: 40px 10px; font-size: 14px; }
.cm { display: flex; gap: 10px; padding: 10px 0; }
.cm .av { width: 36px; height: 36px; font-size: 13px; }
.cm__body { flex: 1; min-width: 0; }
.cm__name { font-size: 12.5px; color: rgba(255,255,255,.6); font-weight: 600; }
.cm__tag { display: inline-block; margin-inline-start: 6px; padding: 1px 7px; border-radius: 6px; font-size: 10.5px; background: rgba(254,44,85,.18); color: #FF7D96; }
.cm__tag--law { background: rgba(37,244,238,.14); color: #7FF5F1; }
.cm__text { font-size: 14.5px; line-height: 1.7; margin: 2px 0; word-wrap: break-word; white-space: pre-wrap; }
.cm__meta { font-size: 12px; color: rgba(255,255,255,.45); display: flex; gap: 14px; }
.cm__meta button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.cm-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.cm-form input { flex: 1; min-width: 0; padding: 11px 16px; border-radius: 999px; border: 0; background: #262626; color: #fff; font: inherit; font-size: 14.5px; }
.cm-form input:focus { outline: 2px solid var(--gold); }
.cm-form button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #FE2C55; color: #fff; display: grid; place-items: center; cursor: pointer; }
.cm-form button svg { width: 20px; height: 20px; fill: currentColor; }
[dir="rtl"] .cm-form button svg { transform: scaleX(-1); }
.cm-login { display: block; text-align: center; padding: 14px; margin: 10px 12px; border-radius: 999px; background: #fff; color: #000; font-weight: 700; text-decoration: none; }
.reel__btn.js-comments svg { fill: rgba(255,255,255,.12); }

/* الإبلاغ */
.reel__flag svg { width: 26px; height: 26px; fill: none; }
.reel__flag span { font-size: 11px; opacity: .85; }
.sheet__panel--auto { height: auto; max-height: 86dvh; overflow-y: auto; }
.rp-form { padding: 6px 18px 18px; display: grid; gap: 8px; }
.rp-hint { margin: 6px 0 4px; font-size: 13.5px; color: rgba(255,255,255,.65); line-height: 1.7; }
.rp-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #1C1C1E; cursor: pointer; font-size: 14.5px; }
.rp-opt input { accent-color: #FE2C55; width: 18px; height: 18px; }
.rp-opt:has(input:checked) { outline: 1.5px solid #FE2C55; }
.rp-form textarea { min-height: 70px; padding: 12px 14px; border-radius: 12px; border: 0; background: #262626; color: #fff; font: inherit; font-size: 14px; resize: vertical; }
.rp-send { margin-top: 4px; padding: 13px; border: 0; border-radius: 999px; background: #FE2C55; color: #fff; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.rp-send:disabled { opacity: .6; }
/* عمود الأزرار صار أطول — تصغير يسير ليبقى بعيداً عن الترويسة */
.reel__btn svg { width: 30px; height: 30px; }
.reel__av { width: 46px; height: 46px; }
@media (max-height: 700px) { .reel__side { gap: 8px; bottom: 130px; } .reel__btn svg { width: 26px; height: 26px; } .reel__views { display: none; } }

/* تبويبا «أتابعهم | لك» + زرّ المتابعة على الصورة */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dtabs { display: flex; gap: 22px; align-items: center; }
.dtabs a { position: relative; color: rgba(255,255,255,.62); text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 16px;
  padding: 6px 0; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.dtabs a.on { color: #fff; }
.dtabs a.on::after { content: ""; position: absolute; left: 50%; bottom: -2px; width: 26px; height: 3px; margin-left: -13px; border-radius: 3px; background: #fff; }
.reel__who { position: relative; margin-bottom: 8px; }
.reel__who > a { display: block; }
.reel__follow { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 0;
  background: #FE2C55; color: #fff; font-size: 15px; font-weight: 700; line-height: 22px; cursor: pointer; transition: transform .2s, background .2s; }
.reel__follow.on { background: #fff; color: #FE2C55; font-size: 12px; }
.reel__follow:active { transform: translateX(-50%) scale(.85); }
