/* =============================================================
   MNYILINGA HUB — SHARED STYLES PRO
   Inashughulikia: Design tokens, Navbar, Category bar,
   Theme system, Drawer, Footer, Bottom Nav
   Inatumiwa na: index.html, post.html, na pages zote
   ============================================================= */

/* ─────────────────────────────────────────────────────────────
   DESIGN TOKENS — MNYILINGA BRAND (VOID BLACK)
───────────────────────────────────────────────────────────── */
:root {
  /* Brand colors */
  --dark-bg:      #000000;
  --dark-mid:     #0d0d0d;
  --dark-light:   #1a1a1a;
  --dark-border:  #2e2e2e;
  --blue-primary: #e2e8f0;
  --blue-nav:     #111111;
  --blue-light:   #f8fafc;
  --red-badge:    #e8192c;
  --green-active: #1ED760;
  --white:        #ffffff;
  --text-muted:   #8899aa;
  --gray-400:     #999999;

  /* Surfaces */
  --body-bg:         #000000;
  --card-bg:         #1a1a1a;
  --card-bg-alt:     #141414;
  --body-text:       #e2e8f0;
  --card-text:       #e2e8f0;
  --card-snippet:    #94a3b8;
  --card-time-col:   #64748b;
  --art-date-col:    #64748b;
  --border-light:    #2e2e2e;
  --section-lbl-txt: #e2e8f0;
  --cg-title-col:    #e2e8f0;
  --art-title-col:   #e2e8f0;
  --art-read-col:    #64748b;
  --sniper-bg:       #0d0d0d;
  --sniper-hover:    #1a1a1a;
  --sniper-deep:     #00161e;
  --catbar-bg:       #090909;
  --hero-grad-rgb:   0,0,0;
  --btn-active-text: #0d0d0d;
  --footer-end:      #000000;

  /* Fonts — Barlow family */
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;
  --font-ui:      'Barlow', sans-serif;

  /* Layout */
  --navbar-h:  66px;
  --catbar-h:  38px;
  --tr:        0.18s ease;
}

/* ─────────────────────────────────────────────────────────────
   BASE RESET
───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { user-select: none; -webkit-user-select: none; }

html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: var(--font-ui);
  background: var(--body-bg);
  color: var(--body-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(46px + env(safe-area-inset-bottom, 0px));
  transition: background 0.4s ease, color 0.4s ease;
}

img { display: block; max-width: 100%; object-fit: cover; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-ui); }
ul { list-style: none; }

/* ─────────────────────────────────────────────────────────────
   LOADING SCREEN
───────────────────────────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--dark-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loading-spinner {
  display: flex;
  gap: 3px;
  align-items: center;
}
.loading-spinner span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.loading-spinner span:nth-child(odd)  { background: #024fc3; animation: dnaUp 1.1s ease-in-out infinite; }
.loading-spinner span:nth-child(even) { background: #fba007; animation: dnaDn 1.1s ease-in-out infinite; }
.loading-spinner span:nth-child(1) { animation-delay: 0.00s; }
.loading-spinner span:nth-child(2) { animation-delay: 0.12s; }
.loading-spinner span:nth-child(3) { animation-delay: 0.24s; }
.loading-spinner span:nth-child(4) { animation-delay: 0.36s; }
.loading-spinner span:nth-child(5) { animation-delay: 0.48s; }
.loading-spinner span:nth-child(6) { animation-delay: 0.60s; }
@keyframes dnaUp { 0%,100%{ transform: translateY(-5px); } 50%{ transform: translateY(5px); } }
@keyframes dnaDn { 0%,100%{ transform: translateY(5px);  } 50%{ transform: translateY(-5px); } }

/* ─────────────────────────────────────────────────────────────
   NAVBAR
───────────────────────────────────────────────────────────── */
.navbar {
  background: var(--blue-nav);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
  transition: background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.navbar-logo { display: flex; align-items: center; gap: 10px; }
.navbar-logo img { height: 38px; width: auto; }
.navbar-logo-text {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  line-height: 1;
  position: relative;
  top: 2px;
}
.navbar-logo-fallback {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
}
.navbar-logo-fallback span { font-weight: 400; }
.navbar-actions { display: flex; align-items: center; gap: 18px; }
.navbar-actions button {
  background: none; border: none;
  color: var(--white); font-size: 20px;
  cursor: pointer; padding: 4px;
  transition: opacity 0.2s;
}
.navbar-actions button:hover { opacity: 0.75; }

/* ── GRID MENU BUTTON (badala ya hamburger ya kawaida) ──
   Specificity ya juu (.navbar-actions .navbar-menu-grid-btn) + !important
   kuhakikisha inashinda ".navbar-actions button { background:none }" ── */
.navbar-actions .navbar-menu-grid-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px !important;
  background: rgba(255,255,255,0.08) !important;
  transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.navbar-actions .navbar-menu-grid-btn:hover {
  background: rgba(255,255,255,0.14) !important;
  opacity: 1;
}
.navbar-actions .navbar-menu-grid-btn:active {
  background: rgba(255,255,255,0.2) !important;
  transform: scale(0.92);
}
.navbar-menu-grid-icon rect {
  transition: stroke-width 0.2s ease;
}
/* Ukifungua drawer — bg pekee inaonyesha hali ya "active"; squares zinabaki
   rangi ile ile ya kawaida (currentColor), hazibadiliki rangi kabisa. */
.navbar-actions .navbar-menu-grid-btn.is-open {
  background: rgba(255,255,255,0.2) !important;
}
.navbar-actions .navbar-menu-grid-btn.is-open:active {
  background: rgba(255,255,255,0.28) !important;
}

/* ── ANIMATED HAMBURGER BUTTON ── */
.navbar-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none;
  cursor: pointer; padding: 4px;
  -webkit-tap-highlight-color: transparent;
}
.hbg-bar {
  display: block;
  width: 22px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.68,-0.55,0.265,1.55),
              opacity 0.2s ease,
              width 0.3s ease;
}
/* X state when drawer is open */
.navbar-menu-btn.is-open .hbg-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar-menu-btn.is-open .hbg-bar:nth-child(2) {
  opacity: 0;
  width: 0;
}
.navbar-menu-btn.is-open .hbg-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── NAVBAR LOGO: void black na themes zote → rangi halisi ── */
.navbar-logo svg {
  filter: none;
  transition: filter 0.4s ease;
}

/* ─────────────────────────────────────────────────────────────
   CATEGORY NAV BAR — LIQUID GLASS
───────────────────────────────────────────────────────────── */
.category-nav-bar-wrap {
  position: fixed;
  top: calc(var(--navbar-h) - 3px);
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 480px;
  z-index: 899;
  background: rgba(10, 10, 12, 0.55);
  backdrop-filter: blur(24px) saturate(160%) brightness(1.08);
  -webkit-backdrop-filter: blur(24px) saturate(160%) brightness(1.08);
  border-top: 1px solid rgba(255,255,255,0.10);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  box-shadow:
    0 1px 0 0 rgba(255,255,255,0.04) inset,
    0 8px 32px 0 rgba(0,0,0,0.38);
  transition: background 0.4s ease, border-color 0.4s ease;
}
.category-nav-bar-wrap::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 44px;
  background: linear-gradient(to right, transparent, rgba(10,10,12,0.82));
  pointer-events: none;
  z-index: 2;
  transition: background 0.4s ease;
}
.category-nav-bar-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255,255,255,0.18) 30%,
    rgba(255,255,255,0.28) 50%,
    rgba(255,255,255,0.18) 70%,
    transparent
  );
  pointer-events: none;
  z-index: 3;
}

.category-nav-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-nav-bar::-webkit-scrollbar { display: none; }

/* ── CATEGORY BUTTONS — clean, single border ── */
.hub-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(200, 220, 242, 0.60);
  padding: 6px 13px 5px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 5px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: color 0.22s ease, border-color 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}
.hub-cat-btn i { font-size: 0.65rem; opacity: 0.8; }
.hub-cat-btn:hover {
  color: rgba(255,255,255,0.90);
  border-color: rgba(255,255,255,0.35);
}

/* ── ACTIVE — #1ED760 border + text, no effects ── */
.hub-cat-btn.active {
  color: var(--green-active);
  background: transparent;
  border-color: var(--green-active);
  border-width: 1px;
  font-weight: 800;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: none;
}
.hub-cat-btn.active i { opacity: 1; }

/* ─────────────────────────────────────────────────────────────
   BOOKS BANNER
───────────────────────────────────────────────────────────── */
.theme-banner {
  background: var(--dark-mid);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: var(--catbar-h);
  border-bottom: 1px solid var(--dark-border);
}
.theme-banner-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.7);
  font-weight: 400;
}
.theme-banner-label .theme-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue-primary);
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--blue-primary);
}
.theme-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 5px;
  color: var(--white);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 13px;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-ui);
  letter-spacing: 0.03em;
  transition: border-color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.theme-btn:hover { border-color: var(--blue-primary); background: rgba(255,255,255,0.07); }
.theme-btn svg {
  width: 15px; height: 15px;
}

/* ─────────────────────────────────────────────────────────────
   NAV DRAWER OVERLAY
───────────────────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════
   NAV DRAWER — PREMIUM FULL-SCREEN REDESIGN
   ───────────────────────────────────────────────────────────────
   Muundo: Full-screen takeover, spring animation, glassmorphism
   Mobile-first: imefanyiwa simu PEKE YAKE
   Themes: Zote zinatumia CSS variables zilizopo (--dark-bg, etc.)
   Animation: Scale + translateY + blur → spring unfurl effect
   Inategemea: id="nav-drawer", id="nav-drawer-overlay",
               id="drawer-search-input", id="drawer-search-results"
═══════════════════════════════════════════════════════════════ */

/* ── OVERLAY ─────────────────────────────────────────────────── */
.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.nav-drawer-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* ── DRAWER PANEL — FULL SCREEN TAKEOVER ───────────────────── */
.nav-drawer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--dark-bg);
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Slide-from-top: transform hii ni SALAMA kwa z-index ya navbar kwa sababu
     .nav-drawer bado ina inset:0 (haibadiliki position/top offset yake) —
     translateY hapa inahamisha PANEL YENYEWE ndani ya box yake ya fixed,
     si box nzima. Overlay (z-index:998) inabaki tofauti kabisa na
     inaendelea ku-fade kama kawaida, hivyo navbar (z-index:900)
     haiathiriki kama ilivyokuwa na muundo wa scale/translateY wa awali.
     opacity bado ipo ili panel isionekane "ikiruka" kutoka juu ghafla. */
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.36s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease;
}
.nav-drawer::-webkit-scrollbar { display: none; }

/* ── OPEN STATE ─────────────────────────────────────────────── */
.nav-drawer.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}



/* ── DRAWER TOP BAR — close button only ───────────────────────── */
.nd-drawer-top {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding: 14px 16px 4px;
}

/* ── DRAWER CLOSE BUTTON — muonekano/tabia SAWA na .navbar-menu-grid-btn
   (values zimerudiwa kwa makusudi, si kurithi selector, kwa sababu ile
   imefungwa kwa .navbar-actions pekee). Lengo: mtumiaji asione kama
   button tofauti — ni "hali ya pili" ya button ile ile ya menu. ── */
.nd-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  transition: background 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.nd-close-btn:hover {
  background: rgba(255,255,255,0.14);
}
.nd-close-btn:active {
  background: rgba(255,255,255,0.2);
  transform: scale(0.92);
}

/* ════════════════════════════════════════════════════════════════
   SEARCH SECTION
   Input ya kutafuta + live results dropdown
════════════════════════════════════════════════════════════════ */
.nd-search-wrap {
  padding: 6px 14px 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 2; /* juu ya body — results inaonekana vizuri */
}

/* Search box container */
.nd-search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 12px 16px;
  transition: border-color 0.25s, background 0.25s;
}
.nd-search-inner:focus-within {
  border-color: var(--blue-primary);
  background: rgba(255,255,255,0.08);
}

/* Search icon — supports both FA <i> and inline <svg> */
.nd-search-ico {
  color: rgba(255,255,255,0.35);
  font-size: 13px;
  flex-shrink: 0;
  fill: none;
  stroke: rgba(255,255,255,0.35);
}

/* Search input field */
.nd-search-field,
.nav-drawer-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.nd-search-field::placeholder,
.nav-drawer-search-input::placeholder {
  color: rgba(255,255,255,0.28);
}

/* ESC hint badge — decorative */
.nd-search-esc {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 2px 5px;
  flex-shrink: 0;
}

/* Search results dropdown — ibadilishwa na drawerSearch() JS */
.nav-drawer-search-results,
.nd-results-drop {
  margin-top: 8px;
  display: none;
  flex-direction: column;
  gap: 3px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: none;
}
.nav-drawer-search-results::-webkit-scrollbar { display: none; }
.nav-drawer-search-results.visible {
  display: flex;
}

/* Search result item */
.dss-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.dss-item:active {
  background: rgba(255,255,255,0.09);
  border-color: var(--blue-primary);
}
.dss-thumb {
  width: 44px;
  height: 32px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--dark-light);
}
.dss-title {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.dss-hint {
  font-size: 10px;
  color: rgba(255,255,255,0.22);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 2px 2px;
}
.dss-no-result {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  padding: 10px 4px;
  text-align: center;
}

/* ════════════════════════════════════════════════════════════════
   SCROLLABLE BODY
   Flex: 1 — inachukua nafasi iliyobaki na kuskrolewa
════════════════════════════════════════════════════════════════ */
.nd-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding: 2px 0 env(safe-area-inset-bottom, 20px);
}
.nd-body::-webkit-scrollbar { display: none; }

/* ════════════════════════════════════════════════════════════════
   MAKUNDI (GROUPS)
   Kila group ina label + items
   Separator ya chini kwa kila group isipokuwa ya mwisho
════════════════════════════════════════════════════════════════ */
.nd-group {
  padding: 14px 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nd-group--last {
  border-bottom: none;
  padding-bottom: 24px;
}

/* Group label — KATEGORIA heading ndogo */
.nd-group-lbl {
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  margin: 0 0 10px 6px;
  padding: 0;
}

/* ════════════════════════════════════════════════════════════════
   NAV ITEMS
   Kila item: icon + text + optional badge/count + caret
════════════════════════════════════════════════════════════════ */
.nd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  color: rgba(255,255,255,0.78);
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
  /* Active feedback: subtle background flash */
  transition: background 0.18s ease, color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Tap/click feedback */
.nd-item:active {
  background: rgba(255,255,255,0.07);
  color: var(--white);
}

/* Primary/active item — Nyumbani: blue tint */
.nd-item--primary {
  background: rgba(0,153,214,0.09);
  color: var(--blue-primary);
  border: 1px solid rgba(0,153,214,0.18);
}
.nd-item--primary:active {
  background: rgba(0,153,214,0.16);
}

/* Expandable item (Settings) — cursor pointer */
.nd-item--expand {
  cursor: pointer;
  user-select: none;
}

/* ── Item Icon ── */
.nd-item-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13.5px;
  color: rgba(255,255,255,0.45);
  transition: background 0.18s, color 0.18s;
}
/* Blue-tinted icon kwa primary item */
.nd-item-ico--blue {
  background: rgba(0,153,214,0.15) !important;
  color: var(--blue-primary) !important;
}
.nd-item:active .nd-item-ico {
  background: rgba(255,255,255,0.12);
}

/* ── Item text label ── */
.nd-item-txt {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Caret/arrow ── */
.nd-arrow {
  font-size: 9px;
  color: rgba(255,255,255,0.18);
  flex-shrink: 0;
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1), color 0.2s;
}

/* Expand caret — rotates 180° when .open is added by toggleNdSettings() */
.nd-expand-caret.open {
  transform: rotate(180deg);
  color: var(--blue-primary);
}

/* ── Pill badges (HOT, MPYA) ── */
.nd-pill {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 5px;
  flex-shrink: 0;
}
.nd-pill--red {
  background: var(--red-badge);
  color: #ffffff;
}
.nd-pill--blue {
  background: var(--blue-primary);
  color: #ffffff;
}

/* ── Count chip (saved posts count) ── */
.nd-count {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════
   SETTINGS SUBMENU
   Expandable panel — max-height animation
   Inafunguka/kufungwa na toggleNdSettings() JS function
════════════════════════════════════════════════════════════════ */
.nd-submenu {
  /* Inaanza imefungwa — max-height:0, overflow:hidden */
  max-height: 0;
  overflow: hidden;
  /* Smooth transition: cubic-bezier kwa natural feel */
  transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  /* Indent na left border kwa hierarchy visual */
  margin-left: 14px;
  padding-left: 20px;
  border-left: 1px solid rgba(255,255,255,0.07);
}
/* .open class inaongezwa na toggleNdSettings() */
.nd-submenu.open {
  max-height: 600px; /* Kubwa ya kutosha kwa items zote */
}

/* Submenu item */
.nd-sub-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 4px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.52);
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.nd-sub-item:active {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.05);
}

/* Sub-item icon */
.nd-sub-item > i {
  width: 18px;
  font-size: 12px;
  color: rgba(255,255,255,0.27);
  text-align: center;
  flex-shrink: 0;
}

/* Sub-item main label */
.nd-sub-item > span {
  flex: 1;
}

/* Sub-item English annotation in smaller text */
.nd-sub-item > small {
  font-size: 10.5px;
  color: rgba(255,255,255,0.2);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ════════════════════════════════════════════════════════════════
   STAGGER ENTRANCE ANIMATIONS
   Wakati drawer.open, sections zinaingia moja baada ya nyingine
   Inatoa hisia ya premium, layered content entry
════════════════════════════════════════════════════════════════ */

/* Search inaingia kwanza */
/* Inner drawer animations zimeondolewa — fade ya drawer yenyewe inatosha */

/* ════════════════════════════════════════════════════════════════
   HAMBURGER → X TRANSFORMATION
   .is-open class inawekwa kwenye #navbar-menu-btn na toggleDrawer()
   Inabadilisha bars kuwa X animation
════════════════════════════════════════════════════════════════ */

/* X state when drawer is open — already in original CSS at line ~324
   Tunaacha ile CSS kama ilivyo, inatumia .is-open class */

/* ─────────────────────────────────────────────────────────────
   DON'T MISS IT — cards kabla ya footer (page zote)
───────────────────────────────────────────────────────────── */
.dont-miss-it {
  padding: 28px 16px 18px;
  background: var(--dark-bg);
}
/* Pungua nafasi kati ya 'Don't miss it' na footer */
.dont-miss-it + .footer {
  margin-top: 10px;
}
.dmi-label {
  font-family: var(--font-ui, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 14px;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  -webkit-font-smoothing: antialiased;
}
.dmi-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}
.dmi-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dmi-skeleton {
  height: 78px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  animation: dmiPulse 1.4s ease-in-out infinite;
}
@keyframes dmiPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.dmi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 10px 12px 10px 10px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s, border-color 0.18s, transform 0.15s ease;
}
.dmi-card:active {
  transform: scale(0.985);
  background: rgba(255, 255, 255, 0.08);
}
.dmi-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.13);
}
.dmi-thumb {
  width: 80px;
  min-width: 80px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}
.dmi-info {
  flex: 1;
  min-width: 0;
}
.dmi-cat {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--blue-primary);
  margin-bottom: 4px;
  -webkit-font-smoothing: antialiased;
}
.dmi-title {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.dmi-arrow {
  color: rgba(255, 255, 255, 0.22);
  font-size: 12px;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}
.dmi-card:hover .dmi-arrow {
  color: var(--blue-primary);
  transform: translateX(2px);
}

/* ─────────────────────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────────────────────── */
.footer {
  background: linear-gradient(180deg, var(--dark-mid) 0%, var(--footer-end, #000510) 100%);
  color: #fff;
  padding: 18px 16px 30px;
  text-align: center;
  margin-top: 50px;
  transition: background 0.4s ease;
}
.footer-logo-wrap {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 20px;
}
.footer-logo-wrap img { height: 38px; width: auto; }
.footer hr { border: 0; border-top: 1px solid var(--dark-border); margin: 22px 0; transition: border-color 0.4s ease; }
.follow-title { margin-bottom: 16px; font-size: 13px; font-family: var(--font-display); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.55); }
.social-icons { display: flex; justify-content: center; gap: 24px; font-size: 14.4px; margin-bottom: 28px; }
.social-icons a { color: rgba(255,255,255,0.6); transition: color 0.2s; }
.social-icons a:hover { color: var(--blue-primary); }
.download-title { margin-bottom: 14px; font-size: 12px; font-family: var(--font-display); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.app-buttons { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.app-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  transition: border-color 0.2s, background 0.2s;
}
.app-btn:hover { border-color: var(--blue-primary); background: rgba(255,255,255,0.1); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; margin-bottom: 28px; }
.footer-links a { color: rgba(255,255,255,0.5); font-size: 11.5px; font-family: var(--font-ui); transition: color 0.2s; }
.footer-links a:hover { color: rgba(255,255,255,0.9); }
.copyright { color: rgba(255,255,255,0.3); font-size: 11.5px; font-family: var(--font-ui); max-width: 340px; margin: 0 auto; line-height: 1.6; }
.footer-credit-link {
  color: #fdb913;
  text-decoration: none;
  font-weight: 700;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}
.footer-credit-link:hover { opacity: 0.8; }
.footer-credit-logo {
  width: 11px;
  height: 11px;
  display: inline-block;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────
   BOTTOM NAV
────────────────────────────────────────────────────────── */
/* Bottom nav slides down when drawer is open */
.bottom-nav--hidden {
  opacity: 0;
  pointer-events: none;
}


.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity 0.3s ease, background 0.4s ease;
  width: 100%;
  max-width: 480px;
  z-index: 950;
  background: var(--dark-bg);
  display: flex;
  align-items: stretch;
  height: calc(46px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 0.5px solid rgba(255, 255, 255, 0.10);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-ui);
  font-size: 0.40rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.bottom-nav-item i { font-size: 14px; transition: color 0.2s; }
.bottom-nav-item svg {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s;
  flex-shrink: 0;
}
.bottom-nav-item:hover, .bottom-nav-item.active { color: var(--blue-primary); }
.bottom-nav-item:hover i, .bottom-nav-item.active i { color: var(--blue-primary); }
.bottom-nav-divider { width: 1px; background: var(--dark-border); align-self: stretch; flex-shrink: 0; transition: background 0.4s ease; }

/* ─────────────────────────────────────────────────────────────
   SHARE MODAL / POST SHARE BAR — position fix
   Inakaa juu ya bottom-nav (46px mpya) na safe-area
───────────────────────────────────────────────────────────── */
.post-share-bar,
.share-modal,
.share-bar,
.hub-share-bar,
[class*="share-modal"],
[class*="share-bar"],
[id*="share-modal"],
[id*="share-bar"] {
  bottom: calc(46px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Ficha share modal wakati drawer iko open */
body:has(.nav-drawer.open) .post-share-bar,
body:has(.nav-drawer.open) .share-modal,
body:has(.nav-drawer.open) .share-bar,
body:has(.nav-drawer.open) .hub-share-bar,
body:has(.nav-drawer.open) [class*="share-modal"],
body:has(.nav-drawer.open) [class*="share-bar"],
body:has(.nav-drawer.open) [id*="share-modal"],
body:has(.nav-drawer.open) [id*="share-bar"] {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease !important;
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────────── */
@media (max-width: 360px) {
  .navbar-logo img { height: 32px; }
  .navbar-logo-text { font-size: 17px; }
  .footer-logo-wrap img { height: 32px; }
}

/* ───────────────────────────────────────────────────
   MORE POSTS — white section chini ya page
─────────────────────────────────────────────────────────── */
.bottom-divider {
  background: #f7f8fa !important;
  border-color: #e8e8e8 !important;
}
.more-posts-section,
.more-posts-section .news-card,
.more-posts-section .card-body {
  background: #000000;
}
.more-posts-section .card-headline,
.more-posts-section .card-snippet {
  color: #ffffff;
}
.more-posts-section .card-cat-tag { color: #0099d6; }
.more-posts-section .card-time { color: rgba(255,255,255,0.45); }
.more-posts-section .card-img-wrap { background: #1a1a1a; }
.more-posts-section .section-label { color: #ffffff; }

/* ═══════════════════════════════════════════════════════════════
   CATEGORY PANEL SYSTEM — Mnyilinga HUB
   Carousel style — design inafanana na search recommended cards
   bg nyeusi, namba nyekundu inabaki
═══════════════════════════════════════════════════════════════ */

/* ── OUTER WRAPPER ── */
#cat-panel-outer {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.52s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 50;
}

/* ── INNER PANEL ── */
.cat-panel {
  background: #000000;
  border-top: 3px solid var(--blue-primary);
  transition: opacity 0.18s ease, transform 0.18s ease;
  animation: catPanelReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cat-panel.cat-panel-fading {
  opacity: 0;
  transform: translateY(-6px) scaleY(0.97);
  transform-origin: top center;
  pointer-events: none;
}

@keyframes catPanelReveal {
  0%   { opacity: 0; transform: translateY(14px) scaleY(0.97); transform-origin: top center; }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scaleY(1); }
}

/* ── PANEL HEADER ── */
.cat-panel-head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.cat-panel-headline {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(255,255,255,0.42);
  -webkit-font-smoothing: antialiased;
}

.cat-panel-headline strong {
  color: #ffffff;
  font-weight: 800;
  font-style: normal;
}

/* ── COUNT BADGE ── */
.cat-panel-count {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-font-smoothing: antialiased;
}

/* ════════════════════════════════════════
   CAROUSEL — horizontal scroll + snap
   Kama search overlay lakini horizontal
════════════════════════════════════════ */

.cat-panel-carousel-outer {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 14px 14px 14px 10px;
  scroll-padding-left: 10px;
}

.cat-panel-carousel-outer::-webkit-scrollbar {
  display: none;
}

.cat-panel-track {
  display: flex;
  gap: 10px;
  width: max-content;
}

/* ── Card — design ya search rec-card kabisa ── */
.cat-panel-card {
  flex-shrink: 0;
  width: 160px;
  display: block;
  text-decoration: none;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  overflow: hidden;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s, border-color 0.18s, transform 0.15s ease;
  animation: searchCardSpring 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cat-panel-card:active {
  transform: scale(0.97);
  background: rgba(255,255,255,0.09);
}

.cat-panel-card:nth-child(1) { animation-delay: 0.04s; }
.cat-panel-card:nth-child(2) { animation-delay: 0.08s; }
.cat-panel-card:nth-child(3) { animation-delay: 0.12s; }
.cat-panel-card:nth-child(4) { animation-delay: 0.16s; }
.cat-panel-card:nth-child(5) { animation-delay: 0.20s; }
.cat-panel-card:nth-child(6) { animation-delay: 0.24s; }
.cat-panel-card:nth-child(7) { animation-delay: 0.28s; }
.cat-panel-card:nth-child(8) { animation-delay: 0.32s; }
.cat-panel-card:nth-child(n+9) { animation-delay: 0.36s; }

/* ── Picha — 16:9 kama search rec-card ── */
.cat-panel-card-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  display: block;
  position: relative;
}

.cat-panel-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Card body — mwili wa chini ── */
.cat-panel-card-body {
  padding: 9px 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Meta row: circle + pill ── */
.cat-panel-card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ── Namba ya mviringo nyekundu ── */
.cat-panel-card-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red-badge);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  -webkit-font-smoothing: antialiased;
}

/* ── Timestamp pill — connected via pseudo line ── */
.cat-panel-card-cat {
  position: relative;
  display: flex;
  align-items: center;
  -webkit-font-smoothing: antialiased;
}

/* Connector line imeondolewa */

/* Pill shape */
.cat-panel-card-cat-inner {
  background: #1a1a1a;
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  padding: 3px 9px;
  border-radius: 10px;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
}

/* ── Title — nyeupe kama search rec-title, inaonyesha nzima bila kukata ── */
.cat-panel-card-title {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  color: rgba(255,255,255,0.92);
  margin: 0;
  display: block;
  overflow: visible;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

/* ════════════════════════════════════════
   SKELETON CARDS — shimmer wakati loading
════════════════════════════════════════ */

.cat-panel-sk-card {
  flex-shrink: 0;
  width: 160px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.cat-panel-sk-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 400px 100%;
  animation: catSkShimmer 1.4s infinite linear;
  display: block;
}

.cat-panel-sk-body {
  padding: 9px 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cat-panel-sk-line {
  display: block;
  height: 9px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.11) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 400px 100%;
  animation: catSkShimmer 1.4s infinite linear;
}

@keyframes catSkShimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

/* ── ACTIONS AREA ── */
.cat-panel-actions {
  padding: 2px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── CLOSE BUTTON ── */
.cat-panel-close {
  width: 100%;
  background: transparent;
  color: var(--red-badge);
  border: 1.5px solid var(--red-badge);
  border-radius: 12px;
  padding: 11px 16px;
  font-family: var(--font-ui, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

.cat-panel-close:active,
.cat-panel-close:hover {
  background: var(--red-badge);
  color: #ffffff;
}

/* ── EMPTY / ERROR STATE ── */
.cat-panel-empty {
  text-align: center;
  padding: 28px 20px 16px;
  color: rgba(255,255,255,0.35);
  font-size: 13px;
  font-family: var(--font-body, 'Inter', sans-serif);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Hizi classes za zamani zimehifadhiwa kwa ulinzi — hazionekani */
.cat-panel-list,
.cat-panel-item,
.cat-panel-img,
.cat-panel-title,
.cat-panel-arrow,
.cat-panel-seemore,
.cat-panel-done,
.cat-panel-loading,
.cat-panel-loading-dot { display: none; }
/* =============================================================
   MNYILINGA HUB — GLOBAL SEARCH OVERLAY SYSTEM
   Inashughulikia: Search icon click → full-screen blur overlay,
   recommended posts, live search results, smooth animations.
   TOFAUTI NA drawer search — hii ni standalone ya navbar icon.
   ============================================================= */

/* ── SEARCH OVERLAY BACKDROP ── */
#hub-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  /* Overlay yenyewe HAISCROLL — flex column inashughulikia layout */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#hub-search-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── SEARCH CONTAINER ── */
.hub-search-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  /* Flex column: header (frozen) + body (scrollable) */
  display: flex;
  flex-direction: column;
  flex: 1;          /* chukua nafasi yote iliyobaki baada ya overlay kuwa flex */
  min-height: 0;    /* lazima iwepo ili flex child iweze kushrink na kuscroll */
  transform: translateY(-24px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#hub-search-overlay.is-open .hub-search-container {
  transform: translateY(0);
}

/* ── SAVED ARTICLES BAR — frozen (flex item, haiscroll) ── */
.hub-search-saved-bar {
  flex-shrink: 0;   /* haishrinki — inashikilia height yake daima */
  padding: 22px 16px 13px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.38);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-font-smoothing: antialiased;
  text-align: center;
  background: #000000;
}

.hub-search-saved-link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  transition: color 0.18s, text-decoration-color 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.hub-search-saved-link:active,
.hub-search-saved-link:hover {
  color: var(--blue-primary);
  text-decoration-color: var(--blue-primary);
}

/* ── SEARCH TOP BAR (back + input + GO) — frozen (flex item, haiscroll) ── */
.hub-search-topbar {
  flex-shrink: 0;   /* haishrinki — inashikilia height yake daima */
  background: #000000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 14px 14px 14px 10px;
  scroll-padding-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Top row: back + input */
.hub-search-topbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── BACK BUTTON ── */
.hub-search-back {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.85);
  transition: background 0.18s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.hub-search-back:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.92);
}

/* ── SEARCH INPUT WRAP ── */
.hub-search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.hub-search-input-wrap .hub-search-icon-left {
  position: absolute;
  left: 13px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 15px;
  pointer-events: none;
  transition: color 0.2s;
}

.hub-search-input-wrap:focus-within .hub-search-icon-left {
  color: var(--blue-primary);
}

#hub-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.09);
  border: 1.5px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  padding: 12px 44px 12px 40px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  outline: none;
  caret-color: var(--blue-primary);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  letter-spacing: 0.1px;
  /* TEXT QUALITY FIX */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ── Zima × ya browser (native search clear) — tunayo SVG yetu ── */
#hub-search-input::-webkit-search-cancel-button,
#hub-search-input::-webkit-search-decoration,
#hub-search-input::-webkit-search-results-button,
#hub-search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}

#hub-search-input::placeholder {
  color: rgba(255, 255, 255, 0.32);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

#hub-search-input:focus {
  border-color: var(--blue-primary);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(0, 153, 214, 0.15), inset 0 1px 2px rgba(0,0,0,0.2);
}

/* ── CLEAR BUTTON ── */
.hub-search-clear {
  position: absolute;
  right: 11px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.18s, transform 0.18s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.hub-search-clear.visible {
  opacity: 1;
  transform: scale(1);
}

.hub-search-clear:active {
  background: rgba(255, 255, 255, 0.28);
}

/* ── GO BUTTON ROW ── */
.hub-search-go-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.hub-search-go-hint {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.2px;
  -webkit-font-smoothing: antialiased;
  flex: 1;
  padding-left: 2px;
}

/* ── GO BUTTON ── */
#hub-search-go-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 20px;
  background: var(--blue-primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-ui, 'Inter', sans-serif);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #000000;
  -webkit-font-smoothing: antialiased;
  transition: background 0.18s, transform 0.14s, box-shadow 0.18s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 3px 12px rgba(0, 153, 214, 0.35);
  opacity: 0.45;
  pointer-events: none;
  transform: scale(0.95);
}

#hub-search-go-btn.active {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}

#hub-search-go-btn:active {
  transform: scale(0.93);
  box-shadow: 0 1px 6px rgba(0, 153, 214, 0.2);
}

#hub-search-go-btn svg {
  flex-shrink: 0;
}

/* ── SEARCH BODY (below topbar) ── */
.hub-search-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 14px 80px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ── SECTION LABEL WITHIN SEARCH ── */
.hub-search-section-lbl {
  font-family: var(--font-ui, 'Inter', sans-serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 12px;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  -webkit-font-smoothing: antialiased;
}

.hub-search-section-lbl::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
}

/* ── RECOMMENDED GRID (2-col) ── */
.hub-search-recommended {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  animation: searchFadeIn 0.4s ease both;
}

.hub-search-rec-card {
  display: block;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s, border-color 0.18s, transform 0.15s ease;
  animation: searchCardSpring 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hub-search-rec-card:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.09);
}

.hub-search-rec-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.13);
}

/* Stagger delays for recommended cards */
.hub-search-rec-card:nth-child(1) { animation-delay: 0.04s; }
.hub-search-rec-card:nth-child(2) { animation-delay: 0.09s; }
.hub-search-rec-card:nth-child(3) { animation-delay: 0.14s; }
.hub-search-rec-card:nth-child(4) { animation-delay: 0.19s; }
.hub-search-rec-card:nth-child(5) { animation-delay: 0.24s; }
.hub-search-rec-card:nth-child(6) { animation-delay: 0.29s; }

.hub-search-rec-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.04);
}

.hub-search-rec-body {
  padding: 9px 10px 11px;
}

.hub-search-rec-cat {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--blue-primary);
  margin-bottom: 5px;
  -webkit-font-smoothing: antialiased;
}

.hub-search-rec-title {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.36;
  color: rgba(255, 255, 255, 0.92);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── SEARCH RESULTS LIST ── */
#hub-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: searchFadeIn 0.25s ease both;
}

.hub-search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 10px 12px 10px 10px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s, border-color 0.18s, transform 0.15s ease;
  animation: searchCardSpring 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hub-search-result-item:active {
  transform: scale(0.985);
  background: rgba(255, 255, 255, 0.09);
}

.hub-search-result-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.13);
}

/* stagger delay */
.hub-search-result-item:nth-child(1) { animation-delay: 0.02s; }
.hub-search-result-item:nth-child(2) { animation-delay: 0.06s; }
.hub-search-result-item:nth-child(3) { animation-delay: 0.10s; }
.hub-search-result-item:nth-child(4) { animation-delay: 0.14s; }
.hub-search-result-item:nth-child(5) { animation-delay: 0.18s; }
.hub-search-result-item:nth-child(6) { animation-delay: 0.22s; }
.hub-search-result-item:nth-child(7) { animation-delay: 0.26s; }
.hub-search-result-item:nth-child(8) { animation-delay: 0.30s; }

.hub-search-result-thumb {
  width: 80px;
  min-width: 80px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.hub-search-result-info {
  flex: 1;
  min-width: 0;
}

.hub-search-result-cat {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--blue-primary);
  margin-bottom: 4px;
  -webkit-font-smoothing: antialiased;
}

.hub-search-result-title {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.hub-search-result-arrow {
  color: rgba(255, 255, 255, 0.22);
  font-size: 12px;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}

.hub-search-result-item:hover .hub-search-result-arrow {
  color: var(--blue-primary);
  transform: translateX(2px);
}

/* ── NO RESULTS STATE ── */
.hub-search-noresult {
  text-align: center;
  padding: 36px 20px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 14px;
  font-family: var(--font-body, 'Inter', sans-serif);
  line-height: 1.7;
  animation: searchFadeIn 0.25s ease both;
}

.hub-search-noresult i {
  display: block;
  font-size: 28px;
  opacity: 0.3;
  margin-bottom: 10px;
}

.hub-search-noresult strong {
  color: rgba(255, 255, 255, 0.55);
}

/* ── ANIMATIONS ── */
@keyframes searchFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

@keyframes searchCardSpring {
  0%   { opacity: 0; transform: translateY(16px) scale(0.97); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── SEARCH ICON PULSE (on open) ── */
.navbar-actions button[aria-label="Tafuta"].search-active {
  color: var(--blue-primary);
}

/* ── PREVENT BODY SCROLL when search is open ── */
body.hub-search-open {
  overflow: hidden;
}


/* KEEP – Inaondoa browser tap flash; UI inaonekana premium zaidi.
   USIIONDOE / USIBADILISHE. */

* { -webkit-tap-highlight-color: transparent; }
/* ─────────────────────────────────────────────────────────────
   BOTTOM NAV — USER / DASHBOARD BUTTON
   Inabadilisha Books — icon ya mtu + online dot indicator
───────────────────────────────────────────────────────────── */

/* Wrap ya icon + dot kwa uhusiano wa position */
.bn-user-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
}

/* ═════════════════════════════════════════════════════════════
   THEME TOAST — smart notification pill
   Position: fixed, top-center, juu ya kila kitu (z-index: 99999)
   Variants: success (kijani), error (nyekundu), info (blue-primary)
   Auto-detect variant + icon huwekwa na JS kwa class .toast-success /
   .toast-error / .toast-info kwenye #theme-toast (angalia components.js
   au inline script kwenye index.html — function _dashToast()).
───────────────────────────────────────────────────────────────── */

.theme-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -18px) scale(0.96);
  z-index: 99999;

  display: flex;
  align-items: center;
  gap: 13px;

  width: max-content;
  max-width: min(92vw, 440px);
  min-height: 60px;
  padding: 10px 16px 10px 10px;

  border-radius: 9999px;
  border: 1px solid transparent;

  font-family: var(--font-ui);

  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.28s;
}

.theme-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}

/* ── Icon circle (kushoto) ── */
.theme-toast-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toast-icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ── Maandishi ── */
.theme-toast-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.theme-toast-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-toast-desc {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Close button (kulia) ── */
.theme-toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  transition: background 0.15s ease, color 0.15s ease;
}

.theme-toast-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.theme-toast-close svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  fill: none;
}

/* ── VARIANT: SUCCESS (kijani) ── */
.theme-toast.toast-success {
  background: color-mix(in srgb, var(--green-active) 34%, var(--dark-mid) 66%);
  border-color: color-mix(in srgb, var(--green-active) 45%, transparent);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.55);
}

.theme-toast.toast-success .theme-toast-icon {
  background: var(--green-active);
}

.theme-toast.toast-success .theme-toast-icon svg {
  stroke: var(--white);
}

/* ── VARIANT: ERROR (nyekundu) ── */
.theme-toast.toast-error {
  background: color-mix(in srgb, var(--red-badge) 36%, var(--dark-mid) 64%);
  border-color: color-mix(in srgb, var(--red-badge) 48%, transparent);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.55);
}

.theme-toast.toast-error .theme-toast-icon {
  background: color-mix(in srgb, var(--red-badge) 88%, var(--white) 12%);
}

.theme-toast.toast-error .theme-toast-icon svg {
  stroke: var(--white);
}

/* ── VARIANT: INFO (blue-primary ya brand — default) ── */
.theme-toast.toast-info {
  background: color-mix(in srgb, var(--blue-primary) 20%, var(--dark-mid) 80%);
  border-color: color-mix(in srgb, var(--blue-primary) 36%, transparent);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.55);
}

.theme-toast.toast-info .theme-toast-icon {
  background: var(--blue-primary);
}

.theme-toast.toast-info .theme-toast-icon svg {
  stroke: var(--dark-bg);
}

/* ── Mobile: karibu full-width, kingo za mviringo (siyo pill kamili) ── */
@media (max-width: 480px) {
  .theme-toast {
    top: max(14px, env(safe-area-inset-top, 0px));
    max-width: calc(100vw - 24px);
    width: calc(100vw - 24px);
    border-radius: 18px;
    padding: 10px 12px 10px 10px;
  }

  .theme-toast-title,
  .theme-toast-desc {
    white-space: normal;
  }
}

/* Icon ya mtu — inainherit stroke ya .bottom-nav-item */
.bn-user-icon {
  width: 22px;
  height: 22px;
  display: block;
  transition: stroke var(--tr, 0.18s ease);
}