/* Safe visual-only theme layer v3.
   Restores stable light mode and adds optional dark mode without changing PHP logic. */
.ubx-theme-toggle-mini{
  width:34px;height:34px;min-width:34px;border-radius:999px;border:1px solid rgba(37,99,235,.18);
  display:inline-grid;place-items:center;background:rgba(255,255,255,.82);color:#2563eb;
  box-shadow:0 8px 18px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.72);
  -webkit-backdrop-filter:blur(12px) saturate(1.15);backdrop-filter:blur(12px) saturate(1.15);
  cursor:pointer;font-size:16px;line-height:1;font-weight:900;z-index:25;
}
.ubx-theme-toggle-mini:hover{transform:translateY(-1px)}
html.ubx-theme-dark .ubx-theme-toggle-mini, body.ubx-theme-dark .ubx-theme-toggle-mini{
  background:rgba(31,47,72,.82);border-color:rgba(255,255,255,.18);color:#fff;
  box-shadow:0 10px 22px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.14);
}
.navbar .ubx-theme-toggle-mini{margin-left:8px;align-self:center;}
@media(max-width:768px){
  .navbar .ubx-theme-toggle-mini{display:none!important}
  .ubx-ms-brandrow{position:relative!important;}
  .ubx-ms-brandrow .ubx-theme-toggle-mini{position:absolute;right:104px;top:8px;display:grid!important}
}

/* Dark mode: page + main containers. Keep layout untouched. */
html.ubx-theme-dark, body.urbiax-modern-home-v1.ubx-theme-dark{
  background:linear-gradient(180deg,#243852 0%,#1f334d 48%,#172842 100%)!important;
  color:#f8fbff!important;
}
body.urbiax-modern-home-v1.ubx-theme-dark .container,
body.urbiax-modern-home-v1.ubx-theme-dark .main{color:#f8fbff!important;}
body.urbiax-modern-home-v1.ubx-theme-dark .navbar .inner{
  background:linear-gradient(135deg,rgba(40,62,92,.88),rgba(24,49,71,.88))!important;
  border-color:rgba(255,255,255,.15)!important;
  box-shadow:0 18px 40px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.12)!important;
  -webkit-backdrop-filter:blur(18px) saturate(1.15)!important;backdrop-filter:blur(18px) saturate(1.15)!important;
}
body.urbiax-modern-home-v1.ubx-theme-dark .brand-main,
body.urbiax-modern-home-v1.ubx-theme-dark .brand-link,
body.urbiax-modern-home-v1.ubx-theme-dark h1,
body.urbiax-modern-home-v1.ubx-theme-dark h2,
body.urbiax-modern-home-v1.ubx-theme-dark h3{color:#fff!important;}
body.urbiax-modern-home-v1.ubx-theme-dark .brand-sub,
body.urbiax-modern-home-v1.ubx-theme-dark .meta,
body.urbiax-modern-home-v1.ubx-theme-dark .muted{color:#cbd8ef!important;}
body.urbiax-modern-home-v1.ubx-theme-dark .nav-actions .btn,
body.urbiax-modern-home-v1.ubx-theme-dark .ubx-support-chip-header,
body.urbiax-modern-home-v1.ubx-theme-dark .ubx-top-community-chip{
  background:rgba(20,35,55,.72)!important;color:#f8fbff!important;border-color:rgba(255,255,255,.16)!important;
}

@media(max-width:768px){
  body.urbiax-modern-home-v1.ubx-theme-dark .ubx-mobile-superhero{
    background:
      radial-gradient(620px 360px at 0% 0%,rgba(65,128,255,.38),transparent 65%),
      radial-gradient(620px 360px at 105% 20%,rgba(24,210,178,.27),transparent 70%),
      linear-gradient(135deg,#2b4770 0%,#234564 46%,#1f6469 100%)!important;
    box-shadow:0 18px 42px rgba(0,0,0,.18)!important;
  }
  body.urbiax-modern-home-v1.ubx-theme-dark .ubx-ms-support,
  body.urbiax-modern-home-v1.ubx-theme-dark .ubx-ms-auth,
  body.urbiax-modern-home-v1.ubx-theme-dark .ubx-ms-logout,
  body.urbiax-modern-home-v1.ubx-theme-dark .ubx-ms-btn{
    background:rgba(32,51,77,.68)!important;color:#f8fbff!important;border-color:rgba(255,255,255,.18)!important;
    box-shadow:0 12px 26px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.12)!important;
  }
  body.urbiax-modern-home-v1.ubx-theme-dark .ubx-ms-support-copy strong{color:#fff!important}
  body.urbiax-modern-home-v1.ubx-theme-dark .ubx-ms-support-copy small{color:#d8e3f5!important}
}

/* Dark mode panels and listing cards. */
body.urbiax-modern-home-v1.ubx-theme-dark .ubx-home-hero-v6,
body.urbiax-modern-home-v1.ubx-theme-dark .mode-tabs-row,
body.urbiax-modern-home-v1.ubx-theme-dark .local-board-tabs,
body.urbiax-modern-home-v1.ubx-theme-dark .filters-accordion,
body.urbiax-modern-home-v1.ubx-theme-dark .filters-summary,
body.urbiax-modern-home-v1.ubx-theme-dark .ubx-mobile-filter-view-row,
body.urbiax-modern-home-v1.ubx-theme-dark .local-services-panel,
body.urbiax-modern-home-v1.ubx-theme-dark .req-panel,
body.urbiax-modern-home-v1.ubx-theme-dark .publicChatWidget,
body.urbiax-modern-home-v1.ubx-theme-dark .login-note,
body.urbiax-modern-home-v1.ubx-theme-dark .toolbar,
body.urbiax-modern-home-v1.ubx-theme-dark .all-pager,
body.urbiax-modern-home-v1.ubx-theme-dark .pager{
  background:rgba(31,47,72,.84)!important;color:#f8fbff!important;border-color:rgba(255,255,255,.14)!important;
  box-shadow:0 16px 34px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.10)!important;
}
body.urbiax-modern-home-v1.ubx-theme-dark .ubx-community-spotlight{
  background:rgba(31,47,72,.78)!important;color:#f8fbff!important;border-color:rgba(255,255,255,.15)!important;
}
body.urbiax-modern-home-v1.ubx-theme-dark .ubx-community-title{color:#fff!important}
body.urbiax-modern-home-v1.ubx-theme-dark .ubx-community-sub{color:#d6e0f1!important}
body.urbiax-modern-home-v1.ubx-theme-dark .ubx-community-cta{background:rgba(55,78,120,.52)!important;color:#dce7ff!important;border-color:rgba(123,92,255,.35)!important}

body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .card-shell,
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .card,
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .card .body,
body.urbiax-modern-home-v1.ubx-theme-dark .card{
  background:linear-gradient(180deg,rgba(35,52,78,.95),rgba(27,44,68,.95))!important;
  color:#f8fbff!important;border-color:rgba(255,255,255,.14)!important;
  box-shadow:0 18px 36px rgba(0,0,0,.20)!important;
}
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .listing-title,
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .title,
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .price{color:#f8fbff!important;}
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .price,
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .price-deposit-row .price{color:#7aa7ff!important;}
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .meta-row,
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .meta-pill,
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .meta-loc-chip,
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .meta-added,
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .share-mini-label,
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .card .meta,
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .card .meta *{color:#cbd8ef!important;}
body.urbiax-modern-home-v1.ubx-theme-dark #listingsGrid .modern-card-actions a,
body.urbiax-modern-home-v1.ubx-theme-dark .btn,
body.urbiax-modern-home-v1.ubx-theme-dark button{
  border-color:rgba(255,255,255,.16)!important;
}
body.urbiax-modern-home-v1.ubx-theme-dark .modern-card-actions .details-btn,
body.urbiax-modern-home-v1.ubx-theme-dark .modern-card-actions a[href*="view"],
body.urbiax-modern-home-v1.ubx-theme-dark .modern-card-actions a.btn-primary{background:linear-gradient(135deg,#2563eb,#6d5cff)!important;color:#fff!important;}

/* Sidebars in desktop dark mode. */
body.urbiax-modern-home-v1.ubx-theme-dark .local-services-card,
body.urbiax-modern-home-v1.ubx-theme-dark .local-services-empty,
body.urbiax-modern-home-v1.ubx-theme-dark .req-card,
body.urbiax-modern-home-v1.ubx-theme-dark .pcw-message,
body.urbiax-modern-home-v1.ubx-theme-dark .pcw-composer{
  background:rgba(23,38,59,.84)!important;color:#f8fbff!important;border-color:rgba(255,255,255,.12)!important;
}
body.urbiax-modern-home-v1.ubx-theme-dark .local-services-title,
body.urbiax-modern-home-v1.ubx-theme-dark .local-services-head h3,
body.urbiax-modern-home-v1.ubx-theme-dark .req-panel h3{color:#fff!important;}
body.urbiax-modern-home-v1.ubx-theme-dark .local-services-desc,
body.urbiax-modern-home-v1.ubx-theme-dark .local-services-meta,
body.urbiax-modern-home-v1.ubx-theme-dark .local-services-head p,
body.urbiax-modern-home-v1.ubx-theme-dark .req-panel p{color:#d6e0f1!important;}
