/* ═══════════════════════════════════════════════
   Jrss — الشريط السفلي والإعدادات
   الشريط: التبويب النشط يتمدد لحبّة فيها أيقونة + اسم
   ═══════════════════════════════════════════════ */

/* ── الشريط السفلي: فقاعة عائمة ──
   من المرجع: كبسولة تطفو فوق المحتوى بهوامش جانبية، شفّافة يبان
   خلفها المحتوى، وحبّة فاتحة تنزلق خلف التبويب النشط.
   الأسماء ظاهرة دائماً — لا تُكشف عند الضغط. */
.tabbar {
  position: fixed; z-index: 40;
  inset-inline: 14px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: stretch; justify-content: space-between;
  padding: 7px 8px;
  border-radius: 999px;
  background: rgba(30, 21, 22, .58);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow:
    0 10px 34px rgba(0,0,0,.52),
    inset 0 1px 0 rgba(255,255,255,.07);
}

/* الحبّة المنزلقة خلف التبويب النشط */
.tab-blob {
  position: absolute; top: 7px; bottom: 7px;
  inset-inline-start: 0; width: 0;
  border-radius: 999px;
  background: var(--brand-a24);
  box-shadow: inset 0 0 0 1px var(--brand-a24);
  opacity: 0; pointer-events: none;
  /* نابض خفيف: يتجاوز الهدف قليلاً ثم يستقر */
  transition:
    transform 460ms cubic-bezier(.34, 1.32, .48, 1),
    width 460ms cubic-bezier(.34, 1.32, .48, 1),
    opacity 220ms var(--ease);
}
.tab-blob.ready { opacity: 1; }

.tab {
  position: relative; z-index: 1;
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: 46px; padding: 4px 2px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted);
  font: 600 10.5px Inter, sans-serif;
  transition: color 260ms var(--ease), transform 240ms var(--ease);
}
.tab span {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tab.on { color: var(--brand-lt); }
.tab .ic {
  width: 20px; height: 20px; flex: none;
  transition: transform 340ms cubic-bezier(.34, 1.4, .5, 1);
}
.tab.on .ic { transform: translateY(-1px) scale(1.1); }
.tab:active { transform: scale(.93); }
.tab:active .ic { animation: springTap 340ms var(--ease); }

/* ما فيه خط علوي إطلاقاً — الحبّة هي المؤشّر */
.tabbar .tab::before, .tabbar .tab.on::before { content: none; }

@media (max-width: 360px) {
  .tab { font-size: 9.5px; }
  .tab .ic { width: 18px; height: 18px; }
}

/* ── صفوف الإعدادات — مجمّعة بأيقونات ملوّنة ── */
.group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.grow {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; min-height: 62px; padding: var(--s3) var(--s4);
  background: none; border: 0; cursor: pointer;
  color: var(--text); font-family: inherit; text-align: start;
  border-bottom: 1px solid var(--border);
  transition: background 200ms var(--ease);
}
.group .grow:last-child { border-bottom: 0; }
.grow:active { background: var(--surface-2); }

/* مربع الأيقونة الملوّن */
.tile {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
}
.tile .ic { width: 18px; height: 18px; }
.tile.brand { background: var(--brand-a14); color: var(--brand-lt); }
.tile.green { background: rgba(63,185,132,.14); color: var(--up); }
.tile.blue  { background: rgba(90,140,255,.14); color: #7EA2FF; }
.tile.amber { background: rgba(224,164,79,.14); color: var(--warn); }
.tile.violet{ background: rgba(150,110,255,.14); color: #A98BFF; }
.tile.slate { background: var(--surface-3); color: var(--text-2); }

.grow-txt { flex: 1; min-width: 0; }
.grow-txt b {
  display: block; font-size: 14.5px; font-weight: 600;
  letter-spacing: -.1px; line-height: 1.35;
}
.grow-txt span {
  display: block; font-size: 11.5px; color: var(--muted);
  line-height: 1.45; margin-top: 1px;
}
.grow .chev {
  width: 17px; height: 17px; flex: none; color: var(--muted);
  transform: scaleX(-1);
}
[dir="ltr"] .grow .chev { transform: none; }
.grow-val { font-size: 12.5px; color: var(--muted); flex: none; }

/* عنوان المجموعة */
.group-title {
  font-size: 11px; font-weight: 600; letter-spacing: 1.1px;
  color: var(--muted); text-transform: uppercase;
  margin: var(--s5) var(--s1) var(--s2);
}

/* ── مفتاح التشغيل ── */
.sw {
  width: 48px; height: 29px; flex: none; border-radius: 99px; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--border-2);
  position: relative; transition: background 260ms var(--ease), border-color 260ms var(--ease);
}
.sw::after {
  content: ""; position: absolute; top: 2px; inset-inline-start: 2px;
  width: 23px; height: 23px; border-radius: 50%; background: var(--muted);
  transition: transform 300ms var(--ease), background 260ms var(--ease);
}
.sw.on { background: var(--brand); border-color: var(--brand); }
.sw.on::after { background: #fff; transform: translateX(-19px); }
[dir="ltr"] .sw.on::after { transform: translateX(19px); }

/* ── اختيار مقسّم ── */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.seg-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 74px; padding: var(--s3) var(--s2);
  border-radius: var(--r); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font: 600 12.5px Inter, sans-serif;
  transition: all 240ms var(--ease);
}
.seg-btn .ic { width: 19px; height: 19px; }
.seg-btn.on {
  background: var(--brand-a14); border-color: var(--brand);
  color: var(--brand-lt);
}
.seg-btn:active { transform: scale(.95); }
.seg-note { font-size: 10.5px; color: var(--muted); font-weight: 400; }

/* ── مدخل الوقت داخل صف الإعدادات ── */
.tinput {
  flex: none; min-height: 34px; padding: 0 10px;
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); color: var(--text);
  font: 600 14px Inter, sans-serif; font-variant-numeric: tabular-nums;
  color-scheme: dark;   /* بدونه يطلع منتقي الوقت أبيض فاقع */
}
.tinput:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* اختيار مقسّم بأربع خانات — لسقف الإشعارات */
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.seg-4 .seg-btn { min-height: 48px; font-size: 13px; }

/* ── خلفية أسفل الشاشة ──
   الشريط صار عائماً، فالمحتوى يمرّ تحته ويُقصّ فجأة عند حافة الشاشة.
   تدرّج مثبّت يذوّب المحتوى تحت الفقاعة بدل القطع الحاد. */
.bottom-fade {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 35;
  height: calc(120px + env(safe-area-inset-bottom));
  pointer-events: none;
  background: linear-gradient(
    to top,
    var(--bg) 0%,
    rgba(12, 9, 9, .92) 32%,
    rgba(12, 9, 9, .55) 62%,
    transparent 100%
  );
}
