/* ANKLE World + Facebook 2007 compatibility contract.
   Loaded last so a theme/catalog expansion cannot silently restore generic
   black/gray controls or hide the legacy World navigation when shell JS fails. */

/* The legacy page navigation is the emergency exit. Hide it only after the
   shared shell has actually mounted; a blocked or failed shell stays usable. */
body.a96.aos-shell-booting:not(.aos-has-shell) nav.nav,
body.a96.aos-shell-booting:not(.aos-has-shell) .nav,
body.a96.aos-shell-booting:not(.aos-has-shell) #worldNav,
body.a96.aos-shell-booting:not(.aos-has-shell) .world-nav,
body.a96.aos-shell-booting:not(.aos-has-shell) .worldcrumb {
  display:flex!important;
}
/* Do not add another broad shell-mounted hide rule here. Authored pages may
   legitimately use .nav; their composition is content, not platform chrome. */

/* The live Facebook composition deliberately uses a blue identity field.
   Its onboarding copy and action tiles must remain legible inside that field. */
body.theme-campus-2007 .hero-doors {
  color:#fff!important;
  border-top-color:#627aad!important;
}
body.theme-campus-2007 .hero-doors .hero-kicker {
  color:#d8dfea!important;
}
body.theme-campus-2007 .surface-actions :is(a,button) {
  min-height:36px!important;
  background:#edeff4!important;
  color:#3b5998!important;
  border:1px solid #b7c5d9!important;
  border-radius:0!important;
  box-shadow:none!important;
  text-decoration:none!important;
  font-family:"Ankle Facebook UI","Lucida Grande",Tahoma,Verdana,Arial,sans-serif!important;
}
body.theme-campus-2007 .surface-actions :is(a,button):is(:hover,:focus-visible) {
  background:#d8dfea!important;
  color:#1c2a47!important;
  border-color:#8496ba!important;
}
body.theme-campus-2007 .surface-actions :is(.first-use-action,.first-use-profile,.get-started-install) {
  background:#fff!important;
  color:#1c2a47!important;
}
body.theme-campus-2007 .surface-actions :is(.first-use-action,.first-use-profile,.get-started-install) small {
  color:#555!important;
}

/* Generic application controls are pale-blue; primary, selected, and sent
   states are Facebook blue. Black remains ordinary copy, never a CTA fill. */
body.theme-campus-2007 :is(main,[role="main"],.main-panel,.content-panel,.workspace-main)
  :is(button,.btn,[role="button"]):not(#ankle-theme-panel *):not(.hero-collapse-control) {
  background:#edeff4!important;
  color:#3b5998!important;
  border:1px solid #b7c5d9!important;
  border-radius:0!important;
  box-shadow:none!important;
}
body.theme-campus-2007 :is(main,[role="main"],.main-panel,.content-panel,.workspace-main)
  :is(button,.btn,[role="button"]):not(#ankle-theme-panel *):not(.hero-collapse-control):is(:hover,:focus-visible) {
  background:#d8dfea!important;
  color:#1c2a47!important;
  border-color:#8496ba!important;
}
body.theme-campus-2007 :is(main,[role="main"],.main-panel,.content-panel,.workspace-main)
  :is(button.primary,.btn.primary,button[type="submit"],[aria-pressed="true"],.on,.active) {
  background:#3b5998!important;
  color:#fff!important;
  border-color:#1c2a47!important;
}

/* World-local controls have historically carried stronger black inline rules.
   The viewer theme owns control chrome, while owner wallpaper and assets stay
   literal and untouched. */
html[data-ankle-viewer-theme="campus-2007"] body.a96
  :is(.post-react.on,.world-game-play,.world-stream-heart[aria-pressed="true"],
      .world-build-door-form button[type="submit"],[data-scale].active,
      .world-access-chip[aria-pressed="true"],button.primary,.btn.primary) {
  background:#3b5998!important;
  color:#fff!important;
  border-color:#1c2a47!important;
  box-shadow:none!important;
}

/* A missing/failed owner icon keeps a visible World identity instead of an
   empty 18px square. Real transparent images retain their exact pixels. */
#aos-topchips .aos-world-icon[data-world-icon-fallback="true"] {
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:#3b5998!important;
  color:#fff!important;
  border:1px solid #1c2a47!important;
  font-weight:bold!important;
  text-transform:uppercase!important;
}
html[data-ankle-viewer-theme="campus-2007"] body.aos-has-shell #aos-topchips .aos-world-chip {
  background:#3b5998!important;
  color:#fff!important;
  border-color:#1c2a47!important;
}
html[data-ankle-viewer-theme="campus-2007"] #aos-topchips .aos-world-chip > span:last-child {
  color:#fff!important;
}
html[data-ankle-viewer-theme="campus-2007"] #aos-topchips .aos-world-icon img[src=""],
html[data-ankle-viewer-theme="campus-2007"] #aos-topchips .aos-world-icon img:not([src]) {
  display:none!important;
}

/* If the catalog CSS knows the campus mark but an older shell does not create
   it, the repair runtime adds this text primitive without a binary dependency. */
#aos-topchips .aos-brand-campus-wordmark-fallback { display:none; }
html[data-ankle-viewer-theme="campus-2007"] #aos-topchips .aos-brand-campus-wordmark-fallback {
  display:block!important;
  color:#fff!important;
  font:bold 16px/1 "Ankle Facebook UI","Lucida Grande",Tahoma,Verdana,Arial,sans-serif!important;
  letter-spacing:-1px!important;
}

@media(max-width:640px) {
  body.theme-campus-2007 .surface-actions :is(a,button) { min-height:44px!important; }
  body.theme-campus-2007 .hero-doors { display:none!important; }
}
