/* UncleAli v27 — shared theme and layout stability patch.
   Explicitly scoped to known login, original home, NOVA and supported independent surfaces.
   Never hide post interfaces, comments, chats, private data or platform navigation. */
:root,html[data-ua-theme="white"]{--ua27-page:#f8fafc;--ua27-panel:#fff;--ua27-text:#172739;--ua27-muted:#4b5c70;--ua27-border:#dce3eb;--ua27-soft:#f2f6fc;--ua27-link:#244f9c;--ua27-focus:#8752cc;color-scheme:light}
html[data-ua-theme="blue"]{--ua27-page:#edf6ff;--ua27-panel:#fff;--ua27-text:#17344e;--ua27-muted:#48647e;--ua27-border:#caddef;--ua27-soft:#e6f0fe;--ua27-link:#245b9d;--ua27-focus:#8253ca;color-scheme:light}
html[data-ua-theme="dark"]{--ua27-page:#101b2c;--ua27-panel:#1c2a3d;--ua27-text:#eff5ff;--ua27-muted:#bacce0;--ua27-border:#3a506b;--ua27-soft:#243750;--ua27-link:#b4d5ff;--ua27-focus:#ffd16a;color-scheme:dark}
html[data-ua-theme] body{background-color:var(--ua27-page);color:var(--ua27-text)}
html[data-ua-theme] body :is(.ua26-nova-page,.ua-shell,.ua-wrap,.ua22-main,.gc-wrap){color:var(--ua27-text)}
/* Guest login: visual reset must beat old `dark.css` and v17 styles without changing login code. */
html[data-ua-theme] body .ua-nova-welcome-wrap{align-items:start;max-width:1190px;min-width:0}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua25-landing{background:var(--ua27-panel)!important;color:var(--ua27-text)!important;border:1px solid var(--ua27-border)!important;min-width:0}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua25-landing :is(h1,.ua25-intro,.ua26-free-pledge,.ua25-services,.ua25-disclosure,.ua26-cost-note){color:var(--ua27-text)!important}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua25-landing :is(.ua25-services span,.ua26-cost-note,.ua25-disclosure){color:var(--ua27-muted)!important}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua25-photo-grid{display:grid!important;min-height:194px!important;overflow:hidden}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua25-photo{display:block!important;overflow:hidden;position:relative;background:var(--ua27-soft);border-radius:12px}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua25-photo img{display:block!important;width:100%!important;height:100%!important;object-fit:cover!important;position:absolute;inset:0}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua25-photo figcaption{position:absolute;bottom:0;left:0;right:0;color:#fff!important;text-shadow:0 1px 3px #172338;padding:.3rem .6rem;background:linear-gradient(transparent,#142333b9)}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua17-auth-main{min-width:0!important;background:transparent!important;color:var(--ua27-text)!important}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua17-auth-main .login,html[data-ua-theme] body .ua-nova-welcome-wrap .ua17-auth-main .login_innre,html[data-ua-theme] body .ua-nova-welcome-wrap .ua17-auth-main form#login{background:var(--ua27-panel)!important;color:var(--ua27-text)!important;border-color:var(--ua27-border)!important}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua17-auth-main form#login :is(h1,h2,h3,.title,label,.wow_form_fields label,p,small,span:not(.icon),.input-text){color:var(--ua27-text)!important;opacity:1!important}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua17-auth-main form#login :is(input:not([type=checkbox]):not([type=radio]),select,textarea){background:var(--ua27-panel)!important;color:var(--ua27-text)!important;border:1px solid var(--ua27-border)!important;border-radius:10px!important;opacity:1!important}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua17-auth-main form#login input::placeholder{color:var(--ua27-muted)!important;opacity:1!important}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua17-auth-main form#login :is(a,.forgot_password){color:var(--ua27-link)!important}
html[data-ua-theme] body .ua-nova-welcome-wrap .ua17-auth-main form#login :is(button[type=submit],.btn-main,.login-submit){color:white!important;background:linear-gradient(115deg,#2762c9,#138f99)!important;min-height:44px}
html[data-ua-theme] body .ua-nova-welcome-wrap #login .show-password,html[data-ua-theme] body .ua-nova-welcome-wrap #login .show-password a{background:transparent!important;color:var(--ua27-link)!important}
html[data-ua-theme="dark"] body .ua-nova-welcome-wrap .ua17-auth-main :is(.login_innre,form#login){background:var(--ua27-panel)!important;color:var(--ua27-text)!important}
/* Original Home and Stories: use the same chosen mode without changing content permissions or JS. */
html[data-ua-theme] body :is(.post-container,.publisher-box,.wow_content,.panel,.sun_pub_box,.post-wrapper,.wo_user_profile,.wow_main_blogs_bg){border-color:var(--ua27-border)!important}
html[data-ua-theme] body :is(.wow_content,.publisher-box,.post-container,.sun_pub_box,.post-wrapper,.wo_user_profile){background:var(--ua27-panel)!important;color:var(--ua27-text)!important}
html[data-ua-theme] body :is(.publisher-box,.wow_content,.wo_user_profile,.post-container) :is(.postText,.post-description,.post-title,.post-text,.post-heading,.post-meta,small,p,.user-name){color:var(--ua27-text)}
html[data-ua-theme] body :is(.publisher-box,.wow_content,.wo_user_profile,.post-container) :is(input:not([type=checkbox]),textarea,select){background:var(--ua27-panel);color:var(--ua27-text);border-color:var(--ua27-border)}
html[data-ua-theme] body .publisher-box .postText::placeholder,html[data-ua-theme] body .wow_content textarea::placeholder{color:var(--ua27-muted)!important;opacity:1}
html[data-ua-theme] body .header-container{background:var(--ua27-panel)!important;color:var(--ua27-text)!important;border-bottom:1px solid var(--ua27-border)}
html[data-ua-theme] body :is(.navbar-default,.left-sidebar,.sidebar,.sidebar-user-data) {color:var(--ua27-text)}
html[data-ua-theme] body :is(.sidebar a,.left-sidebar a){color:var(--ua27-text)}
html[data-ua-theme] body :is(.wo_user_profile .user-avatar,.wo_user_profile .user-name,.wo_user_profile .user-bottom-nav) {color:var(--ua27-text)!important}
/* Chat: old night-mode CSS no longer rides along to an explicitly white/blue page. */
html[data-ua-theme="white"] body :is(.chat-container,.chat-container .chat-status,.chat-container .wo_chat_tabs,.chat-container .wo_chat_tabs li a){background:var(--ua27-panel)!important;color:var(--ua27-text)!important;border-color:var(--ua27-border)!important}
html[data-ua-theme="blue"] body :is(.chat-container,.chat-container .chat-status,.chat-container .wo_chat_tabs,.chat-container .wo_chat_tabs li a){background:var(--ua27-panel)!important;color:var(--ua27-text)!important;border-color:var(--ua27-border)!important}
html[data-ua-theme="dark"] body :is(.chat-container,.chat-container .chat-status,.chat-container .wo_chat_tabs,.chat-container .wo_chat_tabs li a){background:var(--ua27-panel)!important;color:var(--ua27-text)!important;border-color:var(--ua27-border)!important}
/* NOVA, Marketplace, Pages, Family and Admin share tokens, not arbitrary page-wide overrides. */
html[data-ua-theme] body :is(.ua-panel,.ua-nova-orbit-card,.ua-nova-gadgets,.ua-live-post,.ua-real-feed,.ua-card,.ua22-card,.gc-card,.gc-panel,.ua-wrap .ua-card){background:var(--ua27-panel)!important;color:var(--ua27-text)!important;border-color:var(--ua27-border)!important}
html[data-ua-theme] body :is(.ua-live-post,.ua-nova-gadgets,.ua22-card,.gc-card) :is(h2,h3,strong,p,span,small){color:inherit}
html[data-ua-theme] body :is(.ua22-main,.gc-wrap,.ua-shell){background:var(--ua27-page);color:var(--ua27-text)}
html[data-ua-theme] body :is(.ua-top,.ua22-header,.gc-top,.navbar-default){background:var(--ua27-panel)!important;color:var(--ua27-text)!important;border-color:var(--ua27-border)!important}
html[data-ua-theme] body :is(.ua-side,.ua-side-bottom,.ua-top){border-color:var(--ua27-border)!important}
html[data-ua-theme] body :is(.ua-side,.ua-side-bottom){background:var(--ua27-panel);color:var(--ua27-text)}
html[data-ua-theme] body :is(.ua-side a,.ua22-header a,.gc-top a){color:var(--ua27-link)}
html[data-ua-theme] body :is(.ua-live-post,.ua-real-feed) :is(a,.ua26-author-link){color:var(--ua27-link)}
/* Do not cover anchors, post composer or bottom buttons on fixed-header/mobile pages. */
html[data-ua-theme] {scroll-padding-top:82px}
html[data-ua-theme] body :is(#publisher-box-focus,#posts,.posts_load,[id^="ua26-"]){scroll-margin-top:95px}
html[data-ua-theme] body .ua-quickdock{display:none!important}
html[data-ua-theme] body.ua26-nova-page .ua-shell{padding-top:1rem;min-height:calc(100vh - 130px)}
html[data-ua-theme] body.ua26-nova-page #ua-main{min-width:0;overflow-wrap:anywhere}
html[data-ua-theme] body .ua-mobile{z-index:80}
html[data-ua-theme] body :is(input,select,textarea,a,button,summary):focus-visible{outline:3px solid var(--ua27-focus)!important;outline-offset:2px}
@media(max-width:930px){html[data-ua-theme] body .ua-nova-welcome-wrap{grid-template-columns:minmax(0,1fr)!important}html[data-ua-theme] body .ua-nova-welcome-wrap .ua17-auth-main{order:0}html[data-ua-theme] body .ua-nova-welcome-wrap .ua25-landing{order:1}}
@media(max-width:600px){html[data-ua-theme] body .ua-nova-welcome-wrap .ua25-photo-grid{min-height:140px!important}html[data-ua-theme] body :is(.ua-shell,.ua-wrap){max-width:100%;min-width:0}html[data-ua-theme] body .ua26-profile-tabs{max-width:100%}}
@media(prefers-reduced-motion:reduce){html[data-ua-theme] body *{animation-duration:.01ms!important;transition-duration:.01ms!important}}
