/* بوابة مشتركي نيو ستار ماكس — تصميم 2: موبايل أولاً، RTL، فاتح/داكن */
:root {
  color-scheme: light;
  --wine: #9D2D53; --wine-hi: #B83A66; --wine-deep: #5e1631; --wine-ink: #ffffff; --charcoal: #232126;
  --bg: #f4f1f3; --surface: #ffffff; --surface-2: #f8f5f7; --border: #ebe3e7; --line: #f0eaed;
  --text: #1c1a1e; --text-2: #48434b; --muted: #77707a;
  --chip: #f7e9ef; --good: #138a55; --good-bg: #e3f5ec; --bad: #c0362c; --bad-bg: #fde9e7; --warn: #a66a00; --warn-bg: #fff2d6;
  --shadow: 0 1px 2px rgba(30, 10, 20, .05), 0 12px 32px -18px rgba(94, 22, 49, .35);
  --shadow-lg: 0 30px 60px -30px rgba(94, 22, 49, .55);
  --ar: "Simplified Arabic", "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --lat: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 20px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --wine: #D24E7C; --wine-hi: #E2668F; --wine-deep: #3b0e1f; --bg: #121014; --surface: #1c1a1f; --surface-2: #232026; --border: #322d35; --line: #29252c;
    --text: #f3eff2; --text-2: #d6cfd5; --muted: #a49ca3; --chip: #3a1f2b;
    --good: #5fd39b; --good-bg: #15301f; --bad: #ff8b80; --bad-bg: #3a1a19; --warn: #f5c56a; --warn-bg: #3a2c12;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -18px rgba(0, 0, 0, .8);
    --shadow-lg: 0 30px 60px -30px rgba(0, 0, 0, .9);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: var(--ar); font-size: 17px; line-height: 1.6;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
input, textarea, button, .lat, bdi[dir="ltr"], .num { font-family: var(--lat), var(--ar); }
.num { font-variant-numeric: tabular-nums; }
img { max-width: 100%; }
svg.i { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
a { color: var(--wine); }
:focus-visible { outline: 3px solid var(--wine-hi); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--wine); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { top: 8px; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.h { font-size: 19px; margin: 18px 4px 12px; display: flex; align-items: center; gap: 8px; }
h1 { font-size: 23px; margin: 0 0 6px; line-height: 1.35; }
h3 { font-size: 17px; margin: 0 0 10px; }

/* ── الرأس ── */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--wine-deep) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: #fff; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 4px 8px; flex: none; box-shadow: 0 4px 14px -6px rgba(0,0,0,.4); }
.logo img { display: block; height: 28px; width: auto; }
.brand-txt b { display: block; font-size: 16px; line-height: 1.2; }
.brand-txt small { color: #ecd6df; font-size: 13px; }

main { max-width: 620px; margin: 0 auto; padding: 16px; outline: none; }
.view { }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view, .pulse::after { animation: none !important; } }

/* ── الأزرار والحقول ── */
.btn { appearance: none; border: 0; border-radius: 14px; background: linear-gradient(135deg, var(--wine-hi), var(--wine)); color: var(--wine-ink);
  font-weight: 700; font-size: 17px; min-height: 52px; padding: 10px 22px; cursor: pointer; touch-action: manipulation; font-family: var(--ar);
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--wine) 80%, transparent); transition: transform .12s, box-shadow .12s, filter .12s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .65; cursor: progress; }
.btn-block { width: 100%; }
.btn-sm { min-height: 42px; padding: 8px 16px; font-size: 15px; border-radius: 12px; }
.btn-ghost { background: rgba(255, 255, 255, .12); color: inherit; border: 1px solid rgba(255, 255, 255, .28); box-shadow: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, .2); filter: none; }
.icon-btn { appearance: none; border: 0; background: transparent; color: inherit; width: 44px; height: 44px; border-radius: 12px; font-size: 18px; cursor: pointer; }
.field { display: block; margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { display: block; font-weight: 700; margin-bottom: 7px; color: var(--text-2); font-size: 15px; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
input[type="text"], input[type="password"], input[type="tel"], textarea {
  width: 100%; min-height: 54px; padding: 12px 16px; font-size: 17px; color: var(--text); background: var(--surface-2);
  border: 1.5px solid var(--border); border-radius: 14px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
textarea { resize: vertical; font-family: var(--ar); }
input:focus, textarea:focus { border-color: var(--wine); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--wine) 16%, transparent); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); background: color-mix(in srgb, var(--bad-bg) 50%, var(--surface)); }
input[dir="ltr"] { text-align: left; }
.name4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.name4 input { font-family: var(--ar); }
.check { display: flex; align-items: center; gap: 10px; margin: -6px 0 16px; min-height: 44px; font-size: 15px; color: var(--text-2); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--wine); }
.pw { position: relative; display: block; }
.pw input { padding-inline-start: 88px; }
.pw-toggle { position: absolute; inset-inline-start: 6px; top: 50%; transform: translateY(-50%); min-height: 42px; min-width: 72px; border: 0; border-radius: 11px;
  background: var(--chip); color: var(--wine); font-weight: 700; font-size: 14px; cursor: pointer; font-family: var(--ar); }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 11px 14px; margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.err.ok { background: var(--good-bg); color: var(--good); }
.ferr { display: block; color: var(--bad); font-size: 14px; margin-top: 5px; font-weight: 600; }
.hint { display: block; font-size: 14px; color: var(--muted); margin: 6px 0 14px; }

/* ── التحميل ── */
.boot { display: grid; place-items: center; align-content: center; gap: 14px; min-height: 60vh; color: var(--muted); }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--border); border-top-color: var(--wine); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── الدخول: واجهة كاملة بهوية الشركة ── */
body:has(#v-login:not([hidden])) { background:
  radial-gradient(120% 70% at 85% -10%, #c84a79 0%, transparent 55%),
  radial-gradient(90% 60% at 0% 0%, #7a1d40 0%, transparent 60%),
  linear-gradient(180deg, var(--wine-deep) 0%, #4a1027 30%, var(--bg) 56%); padding-bottom: 24px; }
.login { min-height: calc(100dvh - 40px); display: grid; align-content: start; justify-items: center; padding-top: 4vh; }
.login-hero { text-align: center; color: #fff; margin-bottom: 22px; }
.login-hero .login-logo { display: inline-grid; place-items: center; background: #fff; border-radius: 22px; padding: 12px 20px; box-shadow: var(--shadow-lg); }
.login-hero .login-logo img { height: 54px; width: auto; display: block; }
.login-hero h1 { color: #fff; font-size: 26px; margin: 18px 0 4px; }
.login-hero p { margin: 0; color: #f2d9e3; font-size: 16px; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 26px; padding: 26px 20px 22px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.login-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.login-foot a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.login-foot a:hover { color: var(--wine); }
.login-perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 420px; margin-top: 16px; }
.perk { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 8px; text-align: center; font-size: 13px; color: var(--text-2); font-weight: 700; }
.perk svg.i { display: block; margin: 0 auto 6px; font-size: 22px; color: var(--wine); }

/* ── اللوحات ── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
#v-onboard .panel h1 { font-size: 22px; }

/* ── الرئيسية ── */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 4px 14px; }
.hello b { display: block; font-size: 22px; line-height: 1.3; }
.hello small { color: var(--muted); font-size: 14px; }
.avatar { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 20px; color: #fff;
  background: linear-gradient(135deg, var(--wine-hi), var(--wine-deep)); box-shadow: var(--shadow); }

/* بطاقة الحالة الكبيرة */
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 20px 18px 18px; color: #fff; margin-bottom: 14px; box-shadow: var(--shadow-lg);
  background: radial-gradient(120% 90% at 100% 0%, #c84a79 0%, transparent 55%), linear-gradient(150deg, var(--wine) 0%, var(--wine-deep) 100%); }
.hero::after { content: ""; position: absolute; inset-inline-start: -60px; bottom: -80px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(255,255,255,.06); }
.hero .st { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 4px 12px 4px 14px; font-size: 14px; font-weight: 700; }
.pulse { position: relative; width: 10px; height: 10px; border-radius: 50%; background: #5fe0a0; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #5fe0a0; animation: ping 1.6s ease-out infinite; }
.pulse.off { background: #ff9b91; } .pulse.off::after { border-color: #ff9b91; animation: none; }
@keyframes ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.hero .plan { font-size: 15px; opacity: .85; margin-top: 14px; }
.hero .speed { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; margin-top: 2px; }
.hero .speed b { font-family: var(--lat); font-size: 44px; line-height: 1; letter-spacing: -1px; }
.hero .speed span { font-family: var(--lat); font-size: 18px; opacity: .85; }
.hero .sub { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.hero .box { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 10px 12px; }
.hero .box .k { display: flex; align-items: center; gap: 6px; font-size: 13px; opacity: .85; }
.hero .box .v { display: block; font-family: var(--lat); font-size: 18px; font-weight: 700; margin-top: 2px; }
/* الجراف الحي: سرعة الخط كل ثانيتين (بدل خانة «التنزيل الآن») */
.hero .livebox { grid-column: 1 / -1; padding: 12px 12px 10px; min-width: 0; }
.hero .livebox .lh { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hero .livebox .lv { display: flex; flex-direction: column; min-width: 0; }
.hero .livebox .lv small { display: flex; align-items: center; gap: 5px; font-size: 12.5px; opacity: .85; }
.hero .livebox .lv b { font-family: var(--lat); font-size: 24px; line-height: 1.15; font-weight: 800; white-space: nowrap; }
.hero .livebox .lv.up b { font-size: 16px; font-weight: 700; opacity: .9; }
.hero .livebox .lpill { margin-inline-start: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.16); white-space: nowrap; }
.hero .livebox .lpill i { width: 7px; height: 7px; border-radius: 50%; background: #5CF2B5; animation: lpulse 1.6s infinite; }
.hero .livebox.wait .lpill i { background: #fff; opacity: .6; animation: none; }
@keyframes lpulse { 0% { box-shadow: 0 0 0 0 rgba(92,242,181,.65); } 70% { box-shadow: 0 0 0 7px rgba(92,242,181,0); } 100% { box-shadow: 0 0 0 0 rgba(92,242,181,0); } }
.hero .livebox svg.lc { display: block; width: 100%; height: 84px; margin-top: 8px; overflow: visible; }
.hero .livebox .lc .ga { fill: rgba(255,255,255,.2); }
.hero .livebox .lc .gl { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.hero .livebox .lc .ul { fill: none; stroke: rgba(255,255,255,.6); stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.hero .livebox .lc .gd { stroke: rgba(255,255,255,.12); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hero .livebox .lf { display: flex; justify-content: space-between; align-items: center; gap: 4px 10px; flex-wrap: wrap; font-size: 12px; opacity: .82; margin-top: 6px; }
.hero .livebox .lf span { display: inline-flex; align-items: center; gap: 4px; }
@media (prefers-reduced-motion: reduce) { .hero .livebox .lpill i { animation: none; } }
/* المفصول: زر يوم تمديد لحين السداد */
.hero .extbox { position: relative; z-index: 1; margin-top: 12px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.hero .extbtn { width: 100%; min-height: 48px; border: 0; border-radius: 14px; background: #fff; color: var(--wine, #8a1f45); font: inherit; font-size: 15.5px; font-weight: 800; cursor: pointer; box-shadow: 0 10px 22px -12px rgba(0,0,0,.5); padding: 10px 14px; }
.hero .extbtn:disabled { opacity: .7; cursor: default; }
.hero .extbox small { text-align: center; font-size: 12px; opacity: .85; }
.hero .extmsg { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 9px 12px; font-size: 13.5px; font-weight: 600; }
.hero .extlink { align-self: center; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff; font: inherit; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 6px 16px; cursor: pointer; }

/* بطاقة الاشتراك والفاتورة */
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile .k { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 700; }
.tile .k svg.i { color: var(--wine); font-size: 18px; }
.tile .big { font-family: var(--lat); font-size: 26px; font-weight: 800; line-height: 1.1; }
.tile .big small { font-family: var(--ar); font-size: 14px; font-weight: 700; color: var(--muted); }
.tile .tag { align-self: flex-start; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; background: var(--chip); color: var(--wine); }
.tag.good { background: var(--good-bg); color: var(--good); } .tag.bad { background: var(--bad-bg); color: var(--bad); } .tag.warn { background: var(--warn-bg); color: var(--warn); }
.ring { --p: 50; --c: var(--good); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; align-self: flex-start;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); }
.ring > span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-family: var(--lat); font-weight: 800; font-size: 17px; line-height: 1; }
.ring.warn { --c: var(--warn); } .ring.bad { --c: var(--bad); }

/* الاستهلاك */
.usage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.usage .hd { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 10px; }
.usage .hd small { color: var(--muted); font-weight: 400; font-size: 13px; }
.ubar { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.ubar .t { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.ubar .t i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--wine-hi), var(--wine)); }
.ubar .v { font-family: var(--lat); font-weight: 700; min-width: 74px; text-align: left; }

/* تفاصيل */
.sub-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow); }
.sub-body { padding: 4px 16px 10px; }
.sec-t { font-size: 13px; font-weight: 700; color: var(--wine); margin: 14px 0 2px; letter-spacing: .2px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .k { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; flex: none; }
.row .k svg.i { font-size: 18px; color: var(--wine); opacity: .85; }
.row .v { font-weight: 700; text-align: left; min-width: 0; overflow-wrap: anywhere; }
.row .v.good { color: var(--good); } .row .v.bad { color: var(--bad); } .row .v.warn { color: var(--warn); }
.note { font-size: 13px; color: var(--muted); margin: 8px 4px 0; text-align: center; }
.push-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.push-box p { margin: 2px 0 0; }

/* ── الرسائل والإعلانات ── */
.news { display: grid; gap: 12px; }
.ann { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); position: relative; }
.ann::before { content: ""; position: absolute; inset-block: 16px; inset-inline-start: 0; width: 4px; border-radius: 0 4px 4px 0; background: var(--wine); }
.ann.pin { background: color-mix(in srgb, var(--chip) 55%, var(--surface)); }
.ann h3 { margin: 0 0 4px; }
.ann time { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.ann p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; color: var(--text-2); }
.ann.msg::before { background: var(--good); }
.ann.msg.unread { background: color-mix(in srgb, var(--good-bg) 55%, var(--surface)); }
.ann.msg.unread h3::after { content: ' • جديدة'; color: var(--good); font-size: 13px; font-weight: 700; }
.badge { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 13px; line-height: 22px; text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--r); }

/* ── التواصل ── */
.chat { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; margin-bottom: 14px; box-shadow: 0 10px 30px -22px rgba(0,0,0,.45); }
.chat-hd { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(135deg, var(--wine), var(--wine-deep)); color: #fff; }
.chat-hd b { display: block; font-size: 16px; } .chat-hd small { opacity: .85; font-size: 12px; }
.chat-av { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.16); display: grid; place-items: center; font-size: 19px; }
.chat-list { height: min(52vh, 420px); overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2, #f6f4f7); }
.chat-empty { margin: auto; text-align: center; color: var(--muted, #888); font-size: 14px; padding: 20px; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 16px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
/* رسالة المشترك (أنت): فقاعة نبيذية على اليمين */
.msg.me { align-self: flex-start; background: linear-gradient(135deg, var(--wine-hi), var(--wine)); color: #fff; border-end-start-radius: 4px; }
/* رد الدعم الفني: فقاعة رمادية متميّزة على اليسار — أغمق من خلفية المحادثة (surface-2) في الفاتح وأفتح منها في الداكن */
/* البوابة تتبع وضع النظام فقط (prefers-color-scheme) ولا تستعمل data-theme */
.msg.staff { align-self: flex-end; background: #e6dde2; color: var(--text); border: 1px solid #d3c6cd; border-end-end-radius: 4px; }
@media (prefers-color-scheme: dark) { .msg.staff { background: #3a343f; border-color: #4d4553; } .msg.staff .who { color: #f08fb0; } }
/* «جاري الرد»: ثلاث نقاط بعد رسالة المشترك لحد ما يوصل الرد (حتى 45 ث) */
.msg.staff.typing { display: inline-flex; gap: 4px; align-items: center; padding: 11px 14px; min-height: 0; }
.msg.staff.typing i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .3; animation: subDots 1.2s infinite ease-in-out; }
.msg.staff.typing i:nth-child(2) { animation-delay: .2s; } .msg.staff.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes subDots { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: .9; transform: translateY(-3px); } }
.msg .who { display: block; font-size: 12px; font-weight: 700; color: var(--wine); margin-bottom: 2px; }
.msg time { display: block; font-size: 11px; opacity: .7; margin-top: 2px; direction: ltr; text-align: end; }
.msg.pending { opacity: .6; }
/* صورة بالمحادثة + زر الإرفاق */
.msg .cimg { display: block; max-width: min(240px, 100%); max-height: 280px; border-radius: 12px; margin: 2px 0 4px; cursor: zoom-in; background: rgba(0,0,0,.05); }
.chat-att { flex: none; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 19px; line-height: 1; cursor: pointer; align-self: flex-end; }
.chat-att:hover, .chat-att:focus-visible { border-color: var(--wine); outline: none; }
/* أزرار الرد السريع تحت رسالة المساعد الآلي */
.qr { align-self: flex-end; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 92%; margin: 2px 0 6px; }
.qrb { font: inherit; font-size: 14px; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--wine); background: var(--surface); color: var(--wine); cursor: pointer; min-height: 36px; }
.qrb:hover, .qrb:focus-visible { background: var(--wine); color: #fff; outline: none; }
@media (prefers-color-scheme: dark) { .qrb { border-color: #f08fb0; color: #f08fb0; background: transparent; } .qrb:hover, .qrb:focus-visible { background: #f08fb0; color: #1d1a20; } }
.chat-cmp { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-cmp textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; font: inherit; background: var(--surface-2, #f6f4f7); color: inherit; max-height: 120px; }
.chat-cmp textarea:focus { outline: none; border-color: var(--wine); }
.chat-snd { width: 46px; border: 0; border-radius: 14px; background: var(--wine); color: #fff; display: grid; place-items: center; cursor: pointer; transform: scaleX(-1); }
.chat-snd:disabled { opacity: .5; }
.chat-soon { border-style: dashed; box-shadow: none; }
.cbadge { position: absolute; top: -4px; inset-inline-end: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
#nb-contact .ico { position: relative; }
.chat-soon p { margin: 4px 0 0; }
.links { display: grid; gap: 10px; }
.link { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; color: var(--text); text-decoration: none; font-weight: 700; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.link:hover { border-color: var(--wine); transform: translateY(-1px); }
.link .li { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 20px; background: var(--wine); }
.link .li.wa { background: #1fa855; } .link .li.fb { background: #1877f2; } .link .li.ph { background: var(--charcoal); }
.link small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }

/* ── بياناتي ── */
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; }
.kv dt { color: var(--muted); font-size: 15px; }
.kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* ── التنقل السفلي: شريط عائم ── */
.bottom { position: fixed; inset-inline: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 560px; margin: 0 auto; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 22px; padding: 6px; box-shadow: var(--shadow-lg); }
.bottom a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; text-decoration: none;
  color: var(--muted); font-size: 12.5px; font-weight: 700; border-radius: 16px; transition: background .15s, color .15s; }
.bottom a .ico { position: relative; display: grid; place-items: center; font-size: 22px; line-height: 1; }
.bottom a[aria-selected="true"] { color: var(--wine); background: var(--chip); }
.nav-badge { position: absolute; top: -6px; inset-inline-end: -12px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; text-align: center; }

/* ── التثبيت ── */
.install { position: relative; z-index: 30; display: flex; align-items: center; gap: 10px; background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); box-shadow: var(--shadow); }
.install img { border-radius: 12px; flex: none; }
.install-txt { flex: 1; min-width: 0; line-height: 1.4; }
.install-txt b { display: block; font-size: 15px; }
.install-txt span { display: block; font-size: 13px; color: var(--muted); }

/* ── إشعار عابر ── */
.toast { position: fixed; inset-inline: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 40; margin: 0 auto; max-width: 480px;
  background: var(--charcoal); color: #fff; border-radius: 14px; padding: 12px 16px; text-align: center; font-size: 15px; box-shadow: var(--shadow-lg); }

@media (min-width: 700px) {
  main { padding: 24px; }
  .name4 { grid-template-columns: repeat(4, 1fr); }
}

/* ── خطك المباشر (كبار المشتركين) ── */
.lstats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.lstats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.lstats small { display: block; color: var(--muted); font-size: 12.5px; }
.lstats b { font-family: var(--lat); font-size: 17px; }
.chart { width: 100%; height: 130px; display: block; border-radius: 12px; background: var(--surface-2); }
.chart .area.dn { fill: color-mix(in srgb, var(--wine) 22%, transparent); } .chart .ln.dn { fill: none; stroke: var(--wine); stroke-width: 1.8; }
.chart .area.upl { fill: color-mix(in srgb, #3b82f6 16%, transparent); } .chart .ln.upl { fill: none; stroke: #3b82f6; stroke-width: 1.4; }
.legend { display: flex; align-items: center; gap: 14px; font-size: 13px; margin-top: 6px; color: var(--muted); }
.legend .k::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: middle; }
.legend .k.dn::before { background: var(--wine); } .legend .k.upl::before { background: #3b82f6; }
.legend small { margin-inline-start: auto; }
.sigrow { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 15px; }
.sigv { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.bars i { width: 4px; border-radius: 2px; background: var(--line); }
.bars i:nth-child(1) { height: 25%; } .bars i:nth-child(2) { height: 50%; } .bars i:nth-child(3) { height: 75%; } .bars i:nth-child(4) { height: 100%; }
.bars.b1 i:nth-child(-n+1), .bars.b2 i:nth-child(-n+2), .bars.b3 i:nth-child(-n+3), .bars.b4 i:nth-child(-n+4) { background: var(--good); }
.bars.b1 i:nth-child(-n+1) { background: var(--bad); } .bars.b2 i:nth-child(-n+2) { background: var(--warn); }

.hero .speed b.grp { font-size: 26px; letter-spacing: 0; line-height: 1.25; overflow-wrap: anywhere; }

/* إشارة اللاسلكي — مقياس ملوّن */
.sigcard { margin-top: 14px; padding: 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); --sc: var(--good); }
.sigcard.g2 { --sc: #2fae6a; } .sigcard.g1 { --sc: var(--warn); } .sigcard.g0 { --sc: var(--bad); }
.sigtop { display: flex; justify-content: space-between; align-items: center; }
.sigt { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text-2); }
.sigt svg.i { color: var(--sc); font-size: 18px; }
.sigq { font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: 999px; color: var(--sc); background: color-mix(in srgb, var(--sc) 14%, transparent); }
.sigval { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; direction: ltr; margin: 6px 0 10px; }
.sigval b { font-family: var(--lat); font-size: 34px; line-height: 1; color: var(--sc); letter-spacing: -1px; }
.sigval small { font-family: var(--lat); color: var(--muted); font-size: 14px; }
.meter { position: relative; height: 10px; border-radius: 99px; direction: ltr;
  background: linear-gradient(90deg, #e2483d 0%, #f0a12a 35%, #e8cf3a 55%, #45c17a 75%, #13a35e 100%); }
.meter .mk { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 4px solid var(--sc);
  transform: translate(-50%, -50%); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.meterlbl { display: flex; justify-content: space-between; direction: ltr; font-size: 12px; color: var(--muted); margin-top: 6px; }
.meterlbl span:first-child { order: 0; } 


/* ── ورقة اختيار التثبيت (تطبيق أندرويد / اختصار المتصفح) ── */
.link-btn { background: none; border: 0; color: var(--wine); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.sheet { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.55); }
.sheet[hidden] { display: none; }
.sheet-card { position: relative; width: 100%; max-width: 480px; background: var(--surface); border-radius: 20px 20px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.35); animation: sheetUp .22s ease; }
@media (min-width: 540px) { .sheet { align-items: center; } .sheet-card { border-radius: 20px; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-card h2 { margin: 0 0 4px; font-size: 19px; }
.sheet-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.sheet-x { position: absolute; top: 12px; inset-inline-start: 12px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: inherit; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; cursor: pointer; color: inherit; font: inherit; text-decoration: none; transition: border-color .15s, filter .15s; }
.opt:hover, .opt:focus-visible { border-color: var(--wine); filter: brightness(1.03); }
.opt-ic { font-size: 24px; flex: none; width: 46px; height: 46px; display: grid; place-items: center; background: var(--surface); border-radius: 12px; }
.opt-txt { flex: 1; min-width: 0; line-height: 1.45; }
.opt-txt b { display: block; font-size: 15.5px; }
.opt-txt small { display: block; font-size: 12.5px; color: var(--muted); }
.opt-go { flex: none; font-size: 13px; color: var(--wine); font-weight: 700; }
.sheet-note { margin: 2px 2px 0; font-size: 13px; color: var(--muted); line-height: 1.55; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }

.opt-badge { flex: none; font-size: 10.5px; font-weight: 700; color: #fff; background: #1f9d55; border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
